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. - Output
info:(...)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 three-element vector {LU_packed, pivots, info}: - 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. - info has the batch shape (...) and dtype I32: getrf's code per matrix, 0 or the first exactly-zero pivot (1-based).
Raises
LucidErrorWhen
a is below 2-D or not float-typed. A singular matrix is reported through info, never raised.