Computes the QR decompositions of one or more matrices.
tf.linalg.qr(
    input, full_matrices=False, name=None
)
  Computes the QR decomposition of each inner matrix in tensor such that tensor[..., :, :] = q[..., :, :] * r[..., :,:])
Currently, the gradient for the QR decomposition is well-defined only when the first P columns of the inner matrix are linearly independent, where P is the minimum of M and N, the 2 inner-most dimmensions of tensor.
# a is a tensor. # q is a tensor of orthonormal matrices. # r is a tensor of upper triangular matrices. q, r = qr(a) q_full, r_full = qr(a, full_matrices=True)
| Args | |
|---|---|
| input | A Tensor. Must be one of the following types:float64,float32,half,complex64,complex128. A tensor of shape[..., M, N]whose inner-most 2 dimensions form matrices of size[M, N]. LetPbe the minimum ofMandN. | 
| full_matrices | An optional bool. Defaults toFalse. If true, compute full-sizedqandr. If false (the default), compute only the leadingPcolumns ofq. | 
| name | A name for the operation (optional). | 
| Returns | |
|---|---|
| A tuple of Tensorobjects (q, r). | |
| q | A Tensor. Has the same type asinput. | 
| r | A Tensor. Has the same type asinput. | 
    © 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
    https://www.tensorflow.org/versions/r2.9/api_docs/python/tf/linalg/qr