# Lu

public final class **Lu** Computes the LU decomposition of one or more square matrices.


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
shape \`\[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 \`0\`
and \`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.

<br />

<br />

<br />

<br />

<br />

### Public Methods

|---|---|
| static \<T, U extends Number\> [Lu](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Lu)\<T, U\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Lu#create(org.tensorflow.op.Scope,%20org.tensorflow.Operand<T>,%20java.lang.Class<U>))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> input, Class\<U\> outputIdxType) Factory method to create a class wrapping a new Lu operation. |
| static \<T\> [Lu](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Lu)\<T, Integer\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Lu#create(org.tensorflow.op.Scope,%20org.tensorflow.Operand<T>))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> input) Factory method to create a class wrapping a new Lu operation using default output types. |
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\> | [lu](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Lu#lu())() A tensor of shape \`\[..., M, M\]\` whose strictly lower triangular part denotes the lower triangular factor \`L\` with unit diagonal, and whose upper triangular part denotes the upper triangular factor \`U\`. |
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<U\> | [p](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Lu#p())() Permutation of the rows encoded as a list of indices in \`0..M-1\`. |

### Inherited Methods

From class [org.tensorflow.op.PrimitiveOp](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp)

|---|---|
| final boolean | [equals](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#equals(java.lang.Object))(Object obj) |
| final int | [hashCode](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#hashCode())() |
| [Operation](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operation) | [op](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#op())() Returns the underlying `https://www.tensorflow.org/api_docs/java/org/tensorflow/Operation` |
| final String | [toString](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#toString())() |

From class java.lang.Object

|---|---|
| boolean | equals(Object arg0) |
| final Class\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| String | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

## Public Methods

#### public static [Lu](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Lu)\<T, U\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> input, Class\<U\> outputIdxType)

Factory method to create a class wrapping a new Lu operation.

##### Parameters

| scope | current scope |
| input | A tensor of shape \`\[..., M, M\]\` whose inner-most 2 dimensions form matrices of size \`\[M, M\]\`. |
|---|---|

##### Returns

- a new instance of Lu

#### public static [Lu](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Lu)\<T, Integer\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> input)

Factory method to create a class wrapping a new Lu operation using default output types.

##### Parameters

| scope | current scope |
| input | A tensor of shape \`\[..., M, M\]\` whose inner-most 2 dimensions form matrices of size \`\[M, M\]\`. |
|---|---|

##### Returns

- a new instance of Lu

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\>
**lu**
()

A tensor of shape \`\[..., M, M\]\` whose strictly lower triangular part denotes the
lower triangular factor \`L\` with unit diagonal, and whose upper triangular part
denotes the upper triangular factor \`U\`.

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<U\>
**p**
()

Permutation of the rows encoded as a list of indices in \`0..M-1\`. Shape is
\`\[..., M\]\`.