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
, andr
modes (along with several legacy modes). Dask does not support any modes. TF only supportsreduced
andcomplete
modes. MXNet only supportsreduced
mode. Torchlinalg.qr
(latestmaster
) does not supportraw
mode.This proposal only includes support for
reduced
andcomplete
modes.NumPy et al provide support for factorization modes via a
mode
keyword. TF supports modes via afull_matrices
keyword, similar to SVD. This proposal uses amode
keyword for possible future support of additional modes.While Torch
linalg.qr
supportsr
mode, it still returns an empty array forq
(due to easier JIT). As this proposal does not includer
mode support, a namedtuple containingq
andr
is always returned.NumPy, CuPy (?), and JAX support returning
h
andtau
arrays containing the Householder reflectors and associated scaling factors, respectively. TF and Torch do not. This proposal does not support returningh
andtau
.