pub trait TracedTensorLinalgExt {
Show 23 methods
// Required methods
fn svd(&self) -> Result<(TracedTensor, TracedTensor, TracedTensor)>;
fn svd_with_options(
&self,
options: SvdOptions,
) -> Result<(TracedTensor, TracedTensor, TracedTensor)>;
fn svd_full(&self) -> Result<(TracedTensor, TracedTensor, TracedTensor)>;
fn qr(&self) -> Result<(TracedTensor, TracedTensor)>;
fn qr_with_options(
&self,
options: QrOptions,
) -> Result<(TracedTensor, TracedTensor)>;
fn eigh(&self) -> Result<(TracedTensor, TracedTensor)>;
fn eigh_with_options(
&self,
options: EighOptions,
) -> Result<(TracedTensor, TracedTensor)>;
fn cholesky(&self) -> Result<TracedTensor>;
fn lu(
&self,
) -> Result<(TracedTensor, TracedTensor, TracedTensor, TracedTensor)>;
fn full_piv_lu(
&self,
) -> Result<(TracedTensor, TracedTensor, TracedTensor, TracedTensor, TracedTensor)>;
fn eig(&self) -> Result<(TracedTensor, TracedTensor)>;
fn solve(&self, b: &TracedTensor) -> Result<TracedTensor>;
fn lstsq(&self, b: &TracedTensor) -> Result<TracedTensor>;
fn full_piv_lu_solve(&self, b: &TracedTensor) -> Result<TracedTensor>;
fn triangular_solve(
&self,
b: &TracedTensor,
left_side: bool,
lower: bool,
transpose_a: bool,
unit_diagonal: bool,
) -> Result<TracedTensor>;
fn slogdet(&self) -> Result<(TracedTensor, TracedTensor)>;
fn det(&self) -> Result<TracedTensor>;
fn inv(&self) -> Result<TracedTensor>;
fn eigvalsh(&self) -> Result<TracedTensor>;
fn eigvals(&self) -> Result<TracedTensor>;
fn pinv(&self) -> Result<TracedTensor>;
fn pinv_with_rtol(&self, rtol: f64) -> Result<TracedTensor>;
fn norm(
&self,
ord: Option<f64>,
dim: Option<&[usize]>,
keepdim: bool,
) -> Result<TracedTensor>;
}Expand description
Linear algebra extension methods for [TracedTensor].
Required Methods§
Sourcefn svd(&self) -> Result<(TracedTensor, TracedTensor, TracedTensor)>
fn svd(&self) -> Result<(TracedTensor, TracedTensor, TracedTensor)>
Build a traced SVD operation with default options.
§Errors
Returns Error::Extension with ErrorKind::Unsupported for an
unsupported dtype, or Error::Validation for invalid graph metadata.
§Deferred errors
Backend numerical failures and concrete shape mismatches can be
reported as Error::Extension or Error::Validation during compile or
execution when symbolic inputs are bound.
Sourcefn svd_with_options(
&self,
options: SvdOptions,
) -> Result<(TracedTensor, TracedTensor, TracedTensor)>
fn svd_with_options( &self, options: SvdOptions, ) -> Result<(TracedTensor, TracedTensor, TracedTensor)>
Build a traced SVD operation with explicit derivative and gauge options.
§Errors
Returns Error::Validation::InvalidArgument for a non-finite or
non-positive derivative epsilon, or Error::Extension for unsupported
dtype and graph registration failures.
§Deferred errors
Solver convergence and symbolic shape checks may be reported during compile or execution.
Sourcefn svd_full(&self) -> Result<(TracedTensor, TracedTensor, TracedTensor)>
fn svd_full(&self) -> Result<(TracedTensor, TracedTensor, TracedTensor)>
Build a traced full-matrices SVD operation returning square U (m x m)
and Vh (n x n), whose trailing n - rank rows span the input’s right
nullspace.
§Errors
Returns Error::Validation when the input is not a batched matrix
(rank >= 2), or Error::Extension for graph registration failures.
§Deferred errors
The active backend returns Error::Extension with
ErrorKind::Unsupported at execution if it does not implement
full-matrices SVD (only the CPU faer provider does in this slice; the
LAPACK provider and GPU backends are unsupported). Automatic
differentiation is intentionally unsupported for the full variant (see
the linalg AD support manifest) and surfaces a typed AD error rather
than a silent thin-SVD fallback.
Sourcefn qr_with_options(
&self,
options: QrOptions,
) -> Result<(TracedTensor, TracedTensor)>
fn qr_with_options( &self, options: QrOptions, ) -> Result<(TracedTensor, TracedTensor)>
Sourcefn eigh(&self) -> Result<(TracedTensor, TracedTensor)>
fn eigh(&self) -> Result<(TracedTensor, TracedTensor)>
Build a traced Hermitian eigendecomposition operation.
§Errors
Returns Error::Extension with ErrorKind::Unsupported for an
unsupported dtype or Error::Validation for invalid graph metadata.
§Deferred errors
Concrete square-shape validation and solver failures may be reported at compile or execution time.
Sourcefn eigh_with_options(
&self,
options: EighOptions,
) -> Result<(TracedTensor, TracedTensor)>
fn eigh_with_options( &self, options: EighOptions, ) -> Result<(TracedTensor, TracedTensor)>
Build a traced Hermitian eigendecomposition with explicit options.
§Errors
Returns Error::Validation::InvalidArgument for an invalid derivative
epsilon, or Error::Extension for unsupported dtype and registration
failures.
§Deferred errors
Symbolic square-shape checks and numerical eigensolver failures may be reported during compile or execution.
Sourcefn cholesky(&self) -> Result<TracedTensor>
fn cholesky(&self) -> Result<TracedTensor>
Build a traced Cholesky factorization operation.
§Errors
Returns Error::Extension with ErrorKind::Unsupported for an
unsupported dtype or Error::Validation for invalid graph metadata.
§Deferred errors
Non-square or non-positive-definite concrete inputs can produce validation or numerical extension errors during compile or execution.
Sourcefn full_piv_lu(
&self,
) -> Result<(TracedTensor, TracedTensor, TracedTensor, TracedTensor, TracedTensor)>
fn full_piv_lu( &self, ) -> Result<(TracedTensor, TracedTensor, TracedTensor, TracedTensor, TracedTensor)>
Build a traced complete-pivot LU factorization operation.
§Errors
Returns Error::Extension with ErrorKind::Unsupported for an
unsupported dtype or Error::Validation for invalid graph metadata.
§Deferred errors
Concrete square-shape checks and backend factorization failures may be reported during compile or execution.
Sourcefn eig(&self) -> Result<(TracedTensor, TracedTensor)>
fn eig(&self) -> Result<(TracedTensor, TracedTensor)>
Build a traced general eigendecomposition operation.
§Errors
Returns Error::Extension with ErrorKind::Unsupported for an
unsupported dtype or Error::Validation for invalid graph metadata.
§Deferred errors
Concrete shape validation and numerical eigensolver failures may be reported during compile or execution.
Sourcefn solve(&self, b: &TracedTensor) -> Result<TracedTensor>
fn solve(&self, b: &TracedTensor) -> Result<TracedTensor>
Build a traced linear solve operation.
§Errors
Returns Error::Validation for incompatible coefficient/rhs metadata
and Error::Extension for unsupported dtype or registration failures.
§Deferred errors
Singular systems and concrete shape mismatches are reported as numerical or validation errors during compile or execution.
Sourcefn lstsq(&self, b: &TracedTensor) -> Result<TracedTensor>
fn lstsq(&self, b: &TracedTensor) -> Result<TracedTensor>
Build a traced least-squares solve argmin_x ||A x - b||_2 for a tall
or square, full-column-rank A, via the thin QR factorization.
§Errors
Returns Error::Validation for an invalid rank (A or b not a
batched matrix, rank < 2), a symbolic shape, a wide/underdetermined
A (rows < cols), or an unsupported dtype (not floating-point or
complex).
§Deferred errors
Backend QR and triangular-solve failures and concrete shape mismatches
are reported during compile or execution. Rank-deficient A is not
detected: R is singular and the result is ill-defined, so callers must
ensure full column rank.
Sourcefn full_piv_lu_solve(&self, b: &TracedTensor) -> Result<TracedTensor>
fn full_piv_lu_solve(&self, b: &TracedTensor) -> Result<TracedTensor>
Build a traced complete-pivot LU solve operation.
§Errors
Returns Error::Validation for incompatible coefficient/rhs metadata
and Error::Extension for unsupported dtype or registration failures.
§Deferred errors
Singular systems and concrete shape mismatches may be reported during compile or execution.
Sourcefn triangular_solve(
&self,
b: &TracedTensor,
left_side: bool,
lower: bool,
transpose_a: bool,
unit_diagonal: bool,
) -> Result<TracedTensor>
fn triangular_solve( &self, b: &TracedTensor, left_side: bool, lower: bool, transpose_a: bool, unit_diagonal: bool, ) -> Result<TracedTensor>
Build a traced triangular solve operation.
§Errors
Returns Error::Validation for incompatible coefficient/rhs shapes or
invalid solve flags, and Error::Extension for unsupported dtype.
§Deferred errors
Singular or zero-diagonal systems can fail numerically during compile or execution after symbolic inputs are bound.
Sourcefn pinv_with_rtol(&self, rtol: f64) -> Result<TracedTensor>
fn pinv_with_rtol(&self, rtol: f64) -> Result<TracedTensor>
Build a traced pseudoinverse with an explicit relative tolerance.
§Errors
Returns Error::Validation::InvalidArgument when rtol is non-finite
or negative, or Error::Extension for unsupported dtype.
§Deferred errors
SVD convergence and concrete shape failures may be reported during compile or execution.