tf.qr
tf.qr
tf.qr
qr( input, full_matrices=None, name=None )
Defined in tensorflow/python/ops/gen_linalg_ops.py
.
See the guide: Math > Matrix Math Functions
Computes the QR decompositions of one or more matrices.
Computes the QR decomposition of each inner matrix in tensor
such that tensor[..., :, :] = q[..., :, :] * r[..., :,:])
# 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
: ATensor
. Must be one of the following types:float64
,float32
,complex64
,complex128
. A tensor of shape[..., M, N]
whose inner-most 2 dimensions form matrices of size[M, N]
. LetP
be the minimum ofM
andN
. -
full_matrices
: An optionalbool
. Defaults toFalse
. If true, compute full-sizedq
andr
. If false (the default), compute only the leadingP
columns ofq
. -
name
: A name for the operation (optional).
Returns:
A tuple of Tensor
objects (q, r).
-
q
: ATensor
. Has the same type asinput
. Orthonormal basis for range ofa
. Iffull_matrices
isFalse
then shape is[..., M, P]
; iffull_matrices
isTrue
then shape is[..., M, M]
. -
r
: ATensor
. Has the same type asinput
. Triangular factor. Iffull_matrices
isFalse
then shape is[..., P, N]
. Iffull_matrices
isTrue
then shape is[..., M, N]
.
© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/qr