Python wrappers
Public Python APIs implemented by this engine symbol.Solve the linear system for .
Shape
a:(..., N, N).b:(..., N)or(..., N, K).- Output: same shape as
b.
References
Giles, "Collected Matrix Derivative Results" (Oxford, 2008), §2.4.
LAPACK sgesv/dgesv; LAPACK Users' Guide §2.5.
See Also
[[lu_factor_op]] : Standalone LU factorisation (no autograd). [[lu_solve_op]] : Apply pre-computed LU factors (no autograd). [[matmul_op]] : Used in the backward outer product .
Parameters
aconst TensorImplPtr&Square float tensor of shape
(..., N, N). Must share dtype and device with b.bconst TensorImplPtr&Right-hand side of shape
(..., N) or (..., N, K).Returns
TensorImplPtrSolution tensor with the same shape as b. When grad mode is active, the result has [[SolveBackward]] wired into the autograd graph with saved as input and saved as output.
Raises
LinAlgErrorWhen
a is not square, not float-typed, when dtypes/devices mismatch between a and b, or when is singular (zero pivot detected by LU).Examples
Single RHS solve: auto x = solve_op(a, b); // a: (n, n), b: (n,) → x: (n,)Batched multi-RHS solve: auto x = solve_op(a, b); // a: (B, n, n), b: (B, n, k)