TensorNetworkOps

Trait TensorNetworkOps 

Source
pub trait TensorNetworkOps: Backend<FloatElem = f64> {
    // Required method
    fn tn_einsum(
        subscripts: &str,
        inputs: Vec<FloatTensor<Self>>,
    ) -> FloatTensor<Self>;
}
Expand description

Trait for backends that support tenferro tensor network operations.

Implement this trait for a Burn backend to enable einsum and other tensor network primitives on that backend’s tensors.

§Examples

use burn::backend::NdArray;
use tenferro_ext_burn::TensorNetworkOps;

// NdArray<f64> implements TensorNetworkOps
let result = <NdArray<f64> as TensorNetworkOps>::tn_einsum(
    "ij,jk->ik",
    vec![a_primitive, b_primitive],
);

Required Methods§

Source

fn tn_einsum( subscripts: &str, inputs: Vec<FloatTensor<Self>>, ) -> FloatTensor<Self>

Perform an einsum contraction on raw backend tensor primitives.

This operates at the primitive level. Prefer the high-level einsum function for typical usage.

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.

Implementations on Foreign Types§

Source§

impl TensorNetworkOps for NdArray<f64>

Source§

fn tn_einsum( subscripts: &str, inputs: Vec<FloatTensor<Self>>, ) -> FloatTensor<Self>

Source§

impl<B, C> TensorNetworkOps for Autodiff<B, C>
where B: TensorNetworkOps, C: CheckpointStrategy,

Source§

fn tn_einsum( subscripts: &str, inputs: Vec<FloatTensor<Self>>, ) -> FloatTensor<Self>

Implementors§