pub trait EagerTensorLinalgExt {
Show 23 methods
// Required methods
fn svd(&self) -> Result<(EagerTensor, EagerTensor, EagerTensor)>;
fn svd_with_options(
&self,
options: SvdOptions,
) -> Result<(EagerTensor, EagerTensor, EagerTensor)>;
fn svd_full(&self) -> Result<(EagerTensor, EagerTensor, EagerTensor)>;
fn qr(&self) -> Result<(EagerTensor, EagerTensor)>;
fn qr_with_options(
&self,
options: QrOptions,
) -> Result<(EagerTensor, EagerTensor)>;
fn lu(&self) -> Result<(EagerTensor, EagerTensor, EagerTensor, EagerTensor)>;
fn full_piv_lu(
&self,
) -> Result<(EagerTensor, EagerTensor, EagerTensor, EagerTensor, EagerTensor)>;
fn full_piv_lu_solve(&self, b: &EagerTensor) -> Result<EagerTensor>;
fn solve(&self, b: &EagerTensor) -> Result<EagerTensor>;
fn lstsq(&self, b: &EagerTensor) -> Result<EagerTensor>;
fn cholesky(&self) -> Result<EagerTensor>;
fn eigh(&self) -> Result<(EagerTensor, EagerTensor)>;
fn eigh_with_options(
&self,
options: EighOptions,
) -> Result<(EagerTensor, EagerTensor)>;
fn eig(&self) -> Result<(EagerTensor, EagerTensor)>;
fn triangular_solve(
&self,
b: &EagerTensor,
left_side: bool,
lower: bool,
transpose_a: bool,
unit_diagonal: bool,
) -> Result<EagerTensor>;
fn slogdet(&self) -> Result<(EagerTensor, EagerTensor)>;
fn det(&self) -> Result<EagerTensor>;
fn inv(&self) -> Result<EagerTensor>;
fn eigvalsh(&self) -> Result<EagerTensor>;
fn eigvals(&self) -> Result<EagerTensor>;
fn pinv(&self) -> Result<EagerTensor>;
fn pinv_with_rtol(&self, rtol: f64) -> Result<EagerTensor>;
fn norm(
&self,
ord: Option<f64>,
dim: Option<&[usize]>,
keepdim: bool,
) -> Result<EagerTensor>;
}Expand description
Linear algebra extension methods for [EagerTensor].
Required Methods§
Sourcefn svd(&self) -> Result<(EagerTensor, EagerTensor, EagerTensor)>
fn svd(&self) -> Result<(EagerTensor, EagerTensor, EagerTensor)>
§Errors
Returns Error::Validation for an invalid rank, shape, or dtype,
Error::Extension with an unsupported-operation or unsupported-dtype
source when the selected backend cannot execute the decomposition, and
Error::RuntimeState when the eager runtime or backend is unavailable.
Sourcefn svd_with_options(
&self,
options: SvdOptions,
) -> Result<(EagerTensor, EagerTensor, EagerTensor)>
fn svd_with_options( &self, options: SvdOptions, ) -> Result<(EagerTensor, EagerTensor, EagerTensor)>
§Errors
Returns Error::Validation when derivative_eps is non-finite or
non-positive, Error::Extension for unsupported dtypes or numerical
non-convergence, and Error::Internal if the extension violates its
output-count contract.
Sourcefn svd_full(&self) -> Result<(EagerTensor, EagerTensor, EagerTensor)>
fn svd_full(&self) -> Result<(EagerTensor, EagerTensor, EagerTensor)>
Full-matrices SVD 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 for an invalid rank, and Error::Extension
with an unsupported-operation source when the active backend does not
implement full-matrices SVD (the CPU faer provider supports it; the
LAPACK provider and GPU backends return an unsupported error in this
slice). Automatic differentiation through the full variant is
unsupported and surfaces a typed error rather than a silent thin
fallback.
Sourcefn qr(&self) -> Result<(EagerTensor, EagerTensor)>
fn qr(&self) -> Result<(EagerTensor, EagerTensor)>
§Errors
Returns Error::Validation for invalid matrix rank or shape,
Error::Extension for unsupported dtypes or numerical failure, and
Error::RuntimeState when the eager runtime or backend is unavailable.
Sourcefn qr_with_options(
&self,
options: QrOptions,
) -> Result<(EagerTensor, EagerTensor)>
fn qr_with_options( &self, options: QrOptions, ) -> Result<(EagerTensor, EagerTensor)>
§Errors
Returns Error::Validation for invalid matrix rank or shape,
Error::Extension for unsupported dtypes or numerical failure, and
Error::Internal if the extension violates its output-count contract.
Sourcefn lu(&self) -> Result<(EagerTensor, EagerTensor, EagerTensor, EagerTensor)>
fn lu(&self) -> Result<(EagerTensor, EagerTensor, EagerTensor, EagerTensor)>
§Errors
Returns Error::Validation for an invalid matrix rank or shape,
Error::Extension for an unsupported dtype or singular numerical
result, and Error::RuntimeState when execution cannot access its
backend.
Sourcefn full_piv_lu(
&self,
) -> Result<(EagerTensor, EagerTensor, EagerTensor, EagerTensor, EagerTensor)>
fn full_piv_lu( &self, ) -> Result<(EagerTensor, EagerTensor, EagerTensor, EagerTensor, EagerTensor)>
§Errors
Returns Error::Validation for an invalid matrix rank or shape,
Error::Extension for unsupported dtypes or singular numerical
results, and Error::Internal if the extension violates its output
contract.
Sourcefn full_piv_lu_solve(&self, b: &EagerTensor) -> Result<EagerTensor>
fn full_piv_lu_solve(&self, b: &EagerTensor) -> Result<EagerTensor>
§Errors
Returns Error::Validation when a and b have incompatible matrix
or batch shapes, Error::Extension for an unsupported dtype or
singular system, and Error::RuntimeState when the backend is
unavailable.
Sourcefn solve(&self, b: &EagerTensor) -> Result<EagerTensor>
fn solve(&self, b: &EagerTensor) -> Result<EagerTensor>
§Errors
Returns Error::Validation for incompatible matrix, batch, or dtype
metadata, Error::Extension for an unsupported dtype or singular
system, and Error::RuntimeState when the backend is unavailable.
Sourcefn lstsq(&self, b: &EagerTensor) -> Result<EagerTensor>
fn lstsq(&self, b: &EagerTensor) -> Result<EagerTensor>
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 when A or b is not a matrix (rank
>= 2), when A is wide (rows < cols; underdetermined), or when the
dtype is not floating-point or complex; Error::Extension for backend
QR or triangular-solve failures; and Error::RuntimeState when the
backend is unavailable. Rank-deficient A is not detected and yields an
ill-defined result.
Sourcefn cholesky(&self) -> Result<EagerTensor>
fn cholesky(&self) -> Result<EagerTensor>
§Errors
Returns Error::Validation for a non-square or invalid-rank input,
Error::Extension for unsupported dtypes or a non-positive-definite
matrix, and Error::RuntimeState when the backend is unavailable.
Sourcefn eigh(&self) -> Result<(EagerTensor, EagerTensor)>
fn eigh(&self) -> Result<(EagerTensor, EagerTensor)>
§Errors
Returns Error::Validation for a non-square or invalid-rank input,
Error::Extension for unsupported dtypes or numerical non-convergence,
and Error::RuntimeState when the backend is unavailable.
Sourcefn eigh_with_options(
&self,
options: EighOptions,
) -> Result<(EagerTensor, EagerTensor)>
fn eigh_with_options( &self, options: EighOptions, ) -> Result<(EagerTensor, EagerTensor)>
§Errors
Returns Error::Validation for an invalid rank, shape, or
derivative_eps, Error::Extension for unsupported dtypes or
non-convergence, and Error::Internal for an output-count violation.
Sourcefn eig(&self) -> Result<(EagerTensor, EagerTensor)>
fn eig(&self) -> Result<(EagerTensor, EagerTensor)>
§Errors
Returns Error::Validation for a non-square or invalid-rank input,
Error::Extension for unsupported dtypes or numerical non-convergence,
and Error::RuntimeState when the backend is unavailable.
Sourcefn triangular_solve(
&self,
b: &EagerTensor,
left_side: bool,
lower: bool,
transpose_a: bool,
unit_diagonal: bool,
) -> Result<EagerTensor>
fn triangular_solve( &self, b: &EagerTensor, left_side: bool, lower: bool, transpose_a: bool, unit_diagonal: bool, ) -> Result<EagerTensor>
§Errors
Returns Error::Validation for incompatible matrix, batch, or dtype
metadata, Error::Extension for unsupported dtypes or a singular
system, and Error::RuntimeState when the backend is unavailable.
Sourcefn slogdet(&self) -> Result<(EagerTensor, EagerTensor)>
fn slogdet(&self) -> Result<(EagerTensor, EagerTensor)>
Return the determinant sign and logarithm of its absolute value.
§Errors
Returns Error::Validation for a non-square input, Error::Extension
for an unsupported dtype or numerical failure, and Error::Internal
if a primitive violates its output contract.
Sourcefn det(&self) -> Result<EagerTensor>
fn det(&self) -> Result<EagerTensor>
Return the determinant.
§Errors
Returns Error::Validation, Error::Extension, Error::RuntimeState,
or Error::Internal under the conditions documented by Self::slogdet.
Sourcefn inv(&self) -> Result<EagerTensor>
fn inv(&self) -> Result<EagerTensor>
Return the matrix inverse.
§Errors
Returns Error::Validation for invalid matrix metadata,
Error::Extension for an unsupported dtype or singular solve, and
Error::RuntimeState when eager execution cannot access its backend.
Sourcefn eigvalsh(&self) -> Result<EagerTensor>
fn eigvalsh(&self) -> Result<EagerTensor>
Return Hermitian eigenvalues without eigenvectors.
§Errors
Returns the validation, unsupported-dtype, numerical-convergence,
runtime-state, or output-contract errors reported by Self::eigh.
Sourcefn pinv(&self) -> Result<EagerTensor>
fn pinv(&self) -> Result<EagerTensor>
Return the Moore-Penrose pseudoinverse with the default tolerance.
§Errors
Returns Error::Validation for invalid matrix metadata,
Error::Extension for unsupported SVD execution, and
Error::Internal for an unexpected decomposition output contract.
Sourcefn pinv_with_rtol(&self, rtol: f64) -> Result<EagerTensor>
fn pinv_with_rtol(&self, rtol: f64) -> Result<EagerTensor>
Return the Moore-Penrose pseudoinverse with an explicit relative tolerance.
§Errors
Returns Error::Validation when rtol is negative or non-finite, plus
the Error::Extension and output-contract errors reported by Self::pinv.
Sourcefn norm(
&self,
ord: Option<f64>,
dim: Option<&[usize]>,
keepdim: bool,
) -> Result<EagerTensor>
fn norm( &self, ord: Option<f64>, dim: Option<&[usize]>, keepdim: bool, ) -> Result<EagerTensor>
Return a vector, matrix, or tensor norm.
§Errors
Returns Error::Validation for an unsupported order/dimension
combination or invalid axes, Error::Extension when a required matrix
decomposition is unsupported, and eager runtime/backend failures.