Expand description
tenferro: traced tensor computation with StableHLO-style IR.
This crate provides a tracing-based tensor computation framework where operations are recorded into a StableHLO-compatible intermediate representation, then compiled and executed on a backend (e.g., CPU).
§Examples
ⓘ
use tenferro::{CpuBackend, Engine, TracedTensor};
let mut engine = Engine::new(CpuBackend::default());
// ... build and execute traced computationsRe-exports§
pub use engine::Engine;pub use sym_dim::SymDim;pub use traced::TracedTensor;
Modules§
- compiler
- eager_
einsum - Eager einsum helpers exposed through the
tenferrofacade. - eager_
exec - einsum
- N-ary einsum with configurable contraction strategy.
- engine
- error
- Error types for the tenferro crate.
- exec
- segment
- ExecProgram segmentation and segment-based dispatch.
- shape_
infer - Output-shape and output-dtype inference for
StdTensorOp. - sym_dim
- traced
Structs§
- CpuBackend
- CPU execution backend.
- DotGeneral
Config - DotGeneral dimension configuration.
- Eager
Context - Shared eager execution context for tensors on a backend.
- Eager
Tensor - Eager tensor with reverse-mode autodiff over concrete tensor values.
- Gather
Config - StableHLO gather dimension configuration.
- PadConfig
- StableHLO pad configuration.
- Scatter
Config - StableHLO scatter dimension configuration.
- Slice
Config - Slice configuration.
- Typed
Tensor - Contiguous column-major typed tensor storage.
Enums§
Traits§
- Tensor
Backend - Standard runtime backend over dynamic
Tensorvalues. - Tensor
Scalar - Sealed trait for scalar types that can be stored in a
Tensor.
Functions§
- cholesky
- Cholesky factorization.
- convert
- Convert a traced tensor to a different dtype.
- det
- Determinant from
slogdet. - eig
- Non-symmetric eigendecomposition.
- eigh
- Hermitian eigenvalue decomposition with a default numerical epsilon.
- eigh_
with_ eps - Hermitian eigenvalue decomposition with an explicit numerical epsilon.
- eigvals
- General eigenvalues only.
- eigvalsh
- Hermitian eigenvalues only.
- inv
- Matrix inverse via
solve(a, eye). - lu
- LU decomposition with partial pivoting.
- matmul
- Matrix multiplication helper for rank-2 traced tensors.
- norm
- Vector or matrix norm.
- pinv
- Moore-Penrose pseudoinverse via the SVD.
- pinv_
with_ rtol - Moore-Penrose pseudoinverse via the SVD with an explicit relative cutoff.
- pow
- Elementwise power helper with NumPy-style broadcasting.
- qr
- QR decomposition.
- slogdet
- Sign and log-absolute-determinant from the LU factorization.
- solve
- Solve a linear system using LU decomposition and triangular solves.
- svd
- Singular value decomposition with a default numerical epsilon.
- svd_
with_ eps - Singular value decomposition with an explicit numerical epsilon.
- triangular_
solve - Solve a triangular linear system.