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