|TensorFlow 1 version|
Computes the LU decomposition of one or more square matrices.
tf.linalg.lu( input, output_idx_type=tf.dtypes.int32, name=None )
The input is a tensor of shape
[..., M, M] whose inner-most 2 dimensions
form square matrices.
The input has to be invertible.
The output consists of two tensors LU and P containing the LU decomposition
of all input submatrices
[..., :, :]. LU encodes the lower triangular and
upper triangular factors.
For each input submatrix of shape
[M, M], L is a lower triangular matrix of
[M, M] with unit diagonal whose entries correspond to the strictly lower
triangular part of LU. U is a upper triangular matrix of shape
[M, M] whose
entries correspond to the upper triangular part, including the diagonal, of LU.
P represents a permutation matrix encoded as a list of indices each between
M-1, inclusive. If P_mat denotes the permutation matrix corresponding to
P, then the L, U and P satisfies P_mat * input = L * U.
Tensor. Must be one of the following types:
complex128. A tensor of shape
[..., M, M]whose inner-most 2 dimensions form matrices of size
output_idx_type: An optional
tf.int32, tf.int64. Defaults to
name: A name for the operation (optional).
A tuple of
Tensor objects (lu, p).
Tensor. Has the same type as