Python wrappers
Public Python APIs implemented by this engine symbol.Compute the LU factorisation of a square matrix.
Shape
- Input
a:(..., n, n). - Output
LU_packed:(..., n, n). - Output
pivots:(..., n)withDtype::I32.
References
LAPACK sgetrf/dgetrf; LAPACK Users' Guide §2.5.
See Also
[[lu_solve_op]] : Apply the factors to solve . [[solve_op]] : End-to-end differentiable linear solve.
Parameters
aconst TensorImplPtr&Square float tensor of shape
(..., n, n). Leading dimensions are treated as independent batch axes — one factorisation is produced per batch element.Returns
std::vector<TensorImplPtr>A two-element vector {LU_packed, pivots}: - LU_packed has the same shape and dtype as a; its upper triangle holds and its strict lower triangle holds the off-diagonal entries of (unit diagonal is implicit). - pivots has shape (..., n) and dtype I32; entries are 1-based row indices matching the LAPACK convention.
Raises
LinAlgErrorWhen
a is not square, not float-typed, or the LAPACK call reports a structural failure.