Expand description
N-ary einsum with configurable contraction strategy.
This module provides free functions einsum and einsum_with. They
build a lazy computation graph; call .eval(&mut engine) on the result to
trigger execution.
§Quick start
ⓘ
use tenferro::einsum::einsum;
use tenferro::engine::Engine;
use tenferro::traced::TracedTensor;
let mut engine = Engine::new(CpuBackend::new());
let a = TracedTensor::from_tensor_concrete_shape(tensor_a);
let b = TracedTensor::from_tensor_concrete_shape(tensor_b);
// Matrix multiply
let c = einsum(&mut engine, &[&a, &b], "ij,jk->ik");
let result = c.eval(&mut engine);Enums§
- Einsum
Optimize - Controls how the contraction path is determined for N-ary einsum.
Functions§
- einsum
- N-ary einsum with default FLOPS-first optimization.
- einsum_
with - N-ary einsum with explicit contraction strategy.