Skip to main content

TracedTensorLinalgExt

Trait TracedTensorLinalgExt 

Source
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§

Source

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.

Source

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.

Source

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), Error::Extension with ErrorKind::Unsupported for integer or boolean dtypes, 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.

Source

fn qr(&self) -> Result<(TracedTensor, TracedTensor)>

Build a traced QR 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 backend QR failures may be reported at compile or execution time for symbolic inputs.

Source

fn qr_with_options( &self, options: QrOptions, ) -> Result<(TracedTensor, TracedTensor)>

Build a traced QR operation with explicit gauge options.

§Errors

Returns Error::Extension with ErrorKind::Unsupported for an unsupported dtype, or Error::Validation for invalid graph metadata.

§Deferred errors

Symbolic shape checks and backend QR failures can be deferred to compile or execution.

Source

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.

Source

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.

Source

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.

Source

fn lu(&self) -> Result<(TracedTensor, TracedTensor, TracedTensor, TracedTensor)>

Build a traced LU factorization operation.

§Errors

Returns Error::Extension with ErrorKind::Unsupported for an unsupported dtype or Error::Validation for invalid graph metadata.

§Deferred errors

Concrete shape checks and backend factorization failures may be reported during compile or execution.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

fn slogdet(&self) -> Result<(TracedTensor, TracedTensor)>

Build a traced sign/log-determinant operation.

§Errors

Returns Error::Validation for invalid matrix metadata or Error::Extension for unsupported dtype and registration failures.

§Deferred errors

Concrete singularity and shape failures can be reported during compile or execution.

Source

fn det(&self) -> Result<TracedTensor>

Build a traced determinant operation.

§Errors

Returns Error::Validation for invalid matrix metadata or Error::Extension for unsupported dtype.

§Deferred errors

Concrete singularity and shape failures may be reported during compile or execution.

Source

fn inv(&self) -> Result<TracedTensor>

Build a traced matrix-inverse operation.

§Errors

Returns Error::Validation for incompatible rank/shape metadata or Error::Extension for unsupported dtype.

§Deferred errors

Singular matrices produce a numerical error during compile or execution.

Source

fn eigvalsh(&self) -> Result<TracedTensor>

Build a traced Hermitian eigenvalue-only operation.

§Errors

Returns Error::Validation for non-square metadata or Error::Extension for unsupported dtype.

§Deferred errors

Concrete square-shape and solver failures may be reported during compile or execution.

Source

fn eigvals(&self) -> Result<TracedTensor>

Build a traced general eigenvalue-only operation.

§Errors

Returns Error::Validation for invalid matrix metadata or Error::Extension for unsupported dtype.

§Deferred errors

Concrete shape and eigensolver failures may be reported during compile or execution.

Source

fn pinv(&self) -> Result<TracedTensor>

Build a traced pseudoinverse operation with the default tolerance.

§Errors

Returns Error::Validation for invalid rank/shape metadata or Error::Extension for unsupported dtype.

§Deferred errors

SVD convergence and concrete shape failures may be reported during compile or execution.

Source

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.

Source

fn norm( &self, ord: Option<f64>, dim: Option<&[usize]>, keepdim: bool, ) -> Result<TracedTensor>

Build a traced vector/matrix norm operation.

§Errors

Returns Error::Validation for an invalid norm order or axis and Error::Extension for unsupported dtype.

§Deferred errors

Symbolic axis and shape checks may be reported during compile or execution.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§