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. The batch axes of and broadcast; the backend then runs BLAS once per aligned slice.
Math
Solves
without ever forming . When unitriangular is set, is
regarded as with for all .
The corresponding reverse-mode rule is
implemented by [[SolveTriangularBackward]].
Shape
a:(*, N, N).b:(*, N, K), or(N,)(vector RHS).- return: the broadcast batch followed by
(N, K), or by(N,)for a vector RHS.
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 dtype of b (shape below).
Raises
ShapeMismatchIf
b breaks the right-hand-side contract above — before any backend call.LucidErrorIf
a is not square, if a and b have mismatched dtype or device, or if either tensor has a non-float dtype.the solution holds$\pm\infty$ / NaN where substitution divided by a zero pivot.