Add specification for computing the qr factorization #126
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR
Notes
Following Torch, MXNet, and TF, this proposal allows for providing a stack of square matrices. NumPy, Dask, and CuPy do not currently support providing stacks.
NumPy supports multiple factorization "modes":
raw,reduced,complete, andrmodes (along with several legacy modes). Dask does not support any modes. TF only supportsreducedandcompletemodes. MXNet only supportsreducedmode. Torchlinalg.qr(latestmaster) does not supportrawmode.This proposal only includes support for
reducedandcompletemodes.NumPy et al provide support for factorization modes via a
modekeyword. TF supports modes via afull_matriceskeyword, similar to SVD. This proposal uses amodekeyword for possible future support of additional modes.While Torch
linalg.qrsupportsrmode, it still returns an empty array forq(due to easier JIT). As this proposal does not includermode support, a namedtuple containingqandris always returned.NumPy, CuPy (?), and JAX support returning
handtauarrays containing the Householder reflectors and associated scaling factors, respectively. TF and Torch do not. This proposal does not support returninghandtau.