torch.linalg.lu
torch.linalg.lu(A, *, pivot=True, out=None)
Computes the LU decomposition with partial pivoting of a matrix.
Letting \mathbb{K} be \mathbb{R} or \mathbb{C}, the LU
   decomposition with partial pivoting of a matrix A \in
   \mathbb{K}^{m \times n} is defined as
  A = PLU\mathrlap{\qquad P \in \mathbb{K}^{m \times m}, L \in
  \mathbb{K}^{m \times k}, U \in \mathbb{K}^{k \times n}}

where k = min(m,n), P is a permutation matrix, L is lower
   triangular with ones on the diagonal and U is upper triangular.
If "pivot"= False and "A" is on GPU, then the LU decomposition
   without pivoting is computed
  A = LU\mathrlap{\qquad L \in \mathbb{K}^{m \times k}, U \in
  \mathbb{K}^{k \times n}}

When "pivot"= False, the returned matrix "P" will be empty. The
   LU decomposition without pivoting may not exist if any of the
   principal minors of "A" is singular. In this case, the output
   matrix may contain inf or NaN.