Skip to main content

EagerTensorLinalgExt

Trait EagerTensorLinalgExt 

Source
pub trait EagerTensorLinalgExt {
    // Required method
    fn solve(&self, b: &EagerTensor) -> Result<EagerTensor>;
}
Expand description

Tensor-owned linear solve. Other eager linear-algebra operations use EagerSessionLinalgExt inside tenferro_ad::EagerRuntime::with_eager_session.

The tensor-owned entry preserves calling-thread no_grad behavior for tracked solves; it must not be called from inside a borrowed session.

§Examples

let x = a.solve(&b)?;
assert_eq!(x.shape(), &[1, 1]);

Required Methods§

Source

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.

§Examples
let x = a.solve(&b)?;
assert_eq!(x.value()?.as_slice::<f64>()?, &[2.0, 2.0]);

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§