fn
solve_triangular_op
→TensorImplPtrint solve_triangular_op(const int & a, const int & b, bool upper, bool unitriangular)Python wrappers
Public Python APIs implemented by this engine symbol.Solve for where is triangular.
Performs a single substitution sweep through ; no factorisation is required. and must share the same dtype and device. Batched inputs are supported on both arguments: the trailing two dimensions are treated as the matrix axes and the broadcast batch loop runs LAPACK once per slice.
Math
Solves
without ever forming . When unitriangular is set, is
regarded as with for all .
The corresponding reverse-mode rule is
implemented in the Python wrapper.
Shape
a:(..., N, N).b:(..., N, K)or(..., N).- return: same shape as
b.
See Also
solve_op— full LU-based dense solve; use when is not known to be triangular.cholesky_op/ldl_factor_op— produce the triangular factors this op back-substitutes through.
Parameters
aTensorImplPtrTriangular coefficient matrix of shape
(..., N, N) with dtype F32 or F64. Only the half indicated by upper is read.bTensorImplPtrRight-hand side of shape
(..., N, K) (or (..., N) for a single RHS), same dtype and device as a.upperbool= NoneIf
true (default), a is interpreted as upper-triangular and back-substitution is used. If false, a is lower-triangular and forward-substitution is used.unitriangularbool= NoneIf
true, the diagonal of a is treated as all-ones regardless of its stored values. Useful for the unit-lower factor produced by LDL and for Householder products. Default is false.Returns
TensorImplPtrSolution with the same shape and dtype as b.
Raises
LucidErrorIf
a is not square, if a and b have mismatched dtype or device, or if either tensor has a non-float dtype.LucidErrorIf LAPACK reports a singular triangular system (zero on the diagonal when
unitriangular is false).Notes
No autograd node is wired; the output TensorImpl is a leaf.