PyTorch torch.geqrf function
PyTorch torch reference manual
torch.geqrf A function in PyTorch for computing the QR decomposition of a matrix, returning the Q and R matrices.
Function definition
torch.geqrf(input)
Returns:
- a - the orthogonal matrix Q
- tau - the factors needed to produce the orthogonal matrix
Usage examples
Example
import
torch
Create a matrix
A
=
torch.
randn
(
3
,
3
)
QR decomposition
a
,
tau
=
torch.
geqrf
(
A
)
(
"a (Q):"
,
a
)
(
"tau:"
,
tau
)