TensorLinalgBackend

Trait TensorLinalgBackend 

Source
pub trait TensorLinalgBackend<T>{
    type Context;

Show 15 methods // Required methods fn has_linalg_support(op: LinalgCapabilityOp) -> bool; fn solve_ex( ctx: &mut Self::Context, a: &Tensor<T>, b: &Tensor<T>, ) -> Result<SolveTensorExResult<T>, Error>; fn solve( ctx: &mut Self::Context, a: &Tensor<T>, b: &Tensor<T>, ) -> Result<Tensor<T>, Error>; fn lu_solve( ctx: &mut Self::Context, factors: &Tensor<T>, pivots: &Tensor<i32>, b: &Tensor<T>, ) -> Result<Tensor<T>, Error>; fn solve_triangular( ctx: &mut Self::Context, a: &Tensor<T>, b: &Tensor<T>, upper: bool, ) -> Result<Tensor<T>, Error>; fn qr( ctx: &mut Self::Context, a: &Tensor<T>, ) -> Result<QrTensorResult<T>, Error>; fn thin_svd( ctx: &mut Self::Context, a: &Tensor<T>, ) -> Result<SvdTensorResult<T>, Error>; fn svdvals( ctx: &mut Self::Context, a: &Tensor<T>, ) -> Result<Tensor<<T as LinalgScalar>::Real>, Error>; fn lu_factor_ex( ctx: &mut Self::Context, a: &Tensor<T>, ) -> Result<LuTensorExResult<T>, Error>; fn lu_factor( ctx: &mut Self::Context, a: &Tensor<T>, ) -> Result<LuTensorResult<T>, Error>; fn lu_factor_no_pivot( ctx: &mut Self::Context, a: &Tensor<T>, ) -> Result<LuTensorResult<T>, Error>; fn cholesky_ex( ctx: &mut Self::Context, a: &Tensor<T>, ) -> Result<CholeskyTensorExResult<T>, Error>; fn cholesky( ctx: &mut Self::Context, a: &Tensor<T>, ) -> Result<Tensor<T>, Error>; fn eigen_sym( ctx: &mut Self::Context, a: &Tensor<T>, ) -> Result<EigenTensorResult<T>, Error>; fn eig( ctx: &mut Self::Context, a: &Tensor<T>, ) -> Result<EigTensorResult<T>, Error>;
}

Required Associated Types§

Required Methods§

Source

fn has_linalg_support(op: LinalgCapabilityOp) -> bool

Source

fn solve_ex( ctx: &mut Self::Context, a: &Tensor<T>, b: &Tensor<T>, ) -> Result<SolveTensorExResult<T>, Error>

Solve a square linear system while returning per-batch numerical status.

§Examples
use tenferro_linalg_prims::TensorLinalgPrims;

fn accepts_backend<B: TensorLinalgPrims<f64>>() {}
let _ = accepts_backend::<todo!()>;
Source

fn solve( ctx: &mut Self::Context, a: &Tensor<T>, b: &Tensor<T>, ) -> Result<Tensor<T>, Error>

Source

fn lu_solve( ctx: &mut Self::Context, factors: &Tensor<T>, pivots: &Tensor<i32>, b: &Tensor<T>, ) -> Result<Tensor<T>, Error>

Source

fn solve_triangular( ctx: &mut Self::Context, a: &Tensor<T>, b: &Tensor<T>, upper: bool, ) -> Result<Tensor<T>, Error>

Source

fn qr( ctx: &mut Self::Context, a: &Tensor<T>, ) -> Result<QrTensorResult<T>, Error>

Source

fn thin_svd( ctx: &mut Self::Context, a: &Tensor<T>, ) -> Result<SvdTensorResult<T>, Error>

Source

fn svdvals( ctx: &mut Self::Context, a: &Tensor<T>, ) -> Result<Tensor<<T as LinalgScalar>::Real>, Error>

Source

fn lu_factor_ex( ctx: &mut Self::Context, a: &Tensor<T>, ) -> Result<LuTensorExResult<T>, Error>

Compute an LU factorization while returning per-batch numerical status.

§Examples
use tenferro_linalg_prims::TensorLinalgPrims;

fn accepts_backend<B: TensorLinalgPrims<f64>>() {}
let _ = accepts_backend::<todo!()>;
Source

fn lu_factor( ctx: &mut Self::Context, a: &Tensor<T>, ) -> Result<LuTensorResult<T>, Error>

Source

fn lu_factor_no_pivot( ctx: &mut Self::Context, a: &Tensor<T>, ) -> Result<LuTensorResult<T>, Error>

Compute an LU factorization without pivoting.

Backends may support this only on a subset of devices or dtypes.

§Examples
use tenferro_linalg_prims::TensorLinalgPrims;

fn accepts_backend<B: TensorLinalgPrims<f64>>() {}
let _ = accepts_backend::<todo!()>;
Source

fn cholesky_ex( ctx: &mut Self::Context, a: &Tensor<T>, ) -> Result<CholeskyTensorExResult<T>, Error>

Compute a Cholesky factorization while returning per-batch numerical status.

§Examples
use tenferro_linalg_prims::TensorLinalgPrims;

fn accepts_backend<B: TensorLinalgPrims<f64>>() {}
let _ = accepts_backend::<todo!()>;
Source

fn cholesky(ctx: &mut Self::Context, a: &Tensor<T>) -> Result<Tensor<T>, Error>

Source

fn eigen_sym( ctx: &mut Self::Context, a: &Tensor<T>, ) -> Result<EigenTensorResult<T>, Error>

Source

fn eig( ctx: &mut Self::Context, a: &Tensor<T>, ) -> Result<EigTensorResult<T>, Error>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§