mindspore.ops.geqrf
- mindspore.ops.geqrf(input)[source]
Perform a QR decomposition on the input tensor
.The tensor is decomposed into the product of an orthogonal matrix Q and an upper triangular matrix R.
Warning
This is an experimental API that is subject to change or deletion.
- Parameters
input (Tensor) – The input tensor.
- Returns
Tuple(y, tau) of 2 tensors.
y (Tensor) - Store the matrices Q and R implicitly. The matrix Q (Householder vectors) is stored below the diagonal, and the elements of matrix R are stored on and above the diagonal.
tau (Tensor) - Store the scaling factors of each Householder transformation (Householder reflection coefficients).
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> input = mindspore.tensor([[-2.0, -1.0], [1.0, 2.0]]) >>> y, tau = mindspore.ops.geqrf(input) >>> print(y) >>> [[ 2.236068 1.7888544] >>> [-0.236068 1.3416407]] >>> print(tau) >>> [1.8944271 0. ]