fn
lu_solve_op
→TensorImplPtrint lu_solve_op(const int & LU, const int & pivots, const int & b)Python wrappers
Public Python APIs implemented by this engine symbol.Solve given the packed LU factors and pivot vector.
Shape
LU:(*, n, n).pivots:LU.shape[:-1].b:(*, n, k), or(n,)(vector RHS).- Output: the broadcast batch followed by
(n, k), or by(n,)for a vector RHS.
References
LAPACK sgetrs/dgetrs; LAPACK Users' Guide §2.5.1.
See Also
[[lu_factor_op]] : Produce the packed factors consumed here. [[solve_op]] : Differentiable one-shot solve (factor + apply).
Parameters
LUconst TensorImplPtr&Packed LU matrix of shape
(..., n, n) as returned by [[lu_factor_op]] — upper triangle holds , strict lower triangle holds the off-diagonal entries of .pivotsconst TensorImplPtr&1-based pivot indices of shape
LU.shape[:-1] and dtype I32.bconst TensorImplPtr&Right-hand side — see Shape.
Returns
TensorImplPtrSolution tensor with the dtype of b.
Raises
ShapeMismatchWhen
pivots is not LU.shape[:-1] or b breaks the right-hand-side contract — before any LAPACK call.LinAlgErrorWhen
LU or b is not a float dtype, or when any argument is null.