Crate tenferro_ext_burn

Crate tenferro_ext_burn 

Source
Expand description

Bridge between the Burn deep learning framework and tenferro tensor network operations.

This crate allows Burn tensors to be used with tenferro’s einsum and tensor network contraction routines, enabling seamless integration of tensor network methods into Burn-based deep learning pipelines.

Burn tensors are treated as row-major boundary values. The bridge normalizes them into tenferro’s internal column-major canonical layout for computation, then materializes row-major buffers again when exporting back to Burn.

§Examples

use burn::backend::NdArray;
use burn::tensor::Tensor;
use tenferro_ext_burn::einsum;

// Matrix multiplication via einsum
let a: Tensor<NdArray<f64>, 2> = Tensor::ones([3, 4], &Default::default());
let b: Tensor<NdArray<f64>, 2> = Tensor::ones([4, 5], &Default::default());
let c: Tensor<NdArray<f64>, 2> = einsum("ij,jk->ik", vec![a, b]);

Re-exports§

pub use convert::burn_to_tenferro;
pub use convert::tenferro_to_burn;

Modules§

backward
Backward-mode support for TensorNetworkOps on Burn’s autodiff backend.
convert
Conversion utilities between Burn tensor primitives and tenferro tensors.
forward
Forward-mode (inference) implementation of TensorNetworkOps for the NdArray backend.

Enums§

Error
Error type for Burn/tenferro bridge failures.

Traits§

TensorNetworkOps
Trait for backends that support tenferro tensor network operations.

Functions§

einsum
High-level infallible einsum convenience wrapper.
try_einsum
Fallible high-level einsum on Burn tensors, dispatching to the backend’s TensorNetworkOps::tn_einsum implementation.

Type Aliases§

Result
Result type for Burn/tenferro bridge operations.