tenferro_ext_burn/
forward.rs

1//! Forward-mode (inference) implementation of [`TensorNetworkOps`] for the
2//! NdArray backend.
3//!
4//! # Current Limitations
5//!
6//! The concrete forward backend implementation is currently `NdArray<f64>`.
7//! `Autodiff<NdArray<f64>>` builds on top of this in [`crate::backward`].
8//! Other backends and element types remain future work.
9
10use burn::backend::NdArray;
11use burn::tensor::ops::FloatTensor;
12
13use crate::{primitive_einsum, TensorNetworkOps};
14
15impl TensorNetworkOps for NdArray<f64> {
16    fn tn_einsum(subscripts: &str, inputs: Vec<FloatTensor<Self>>) -> FloatTensor<Self> {
17        primitive_einsum::<Self>(subscripts, inputs)
18    }
19}