Expand description
Linear algebra extension operations for tenferro.
This crate owns the graph-facing linalg op payloads and runtime registration. Tensor-facing operations are exposed through extension traits. CPU backend kernels live in this crate behind the linalg backend trait.
§Examples
use tenferro_linalg::TracedTensorLinalgExt;
use tenferro_cpu::CpuBackend;
use tenferro_runtime::{GraphCompiler, GraphExecutor, TracedTensor};
let a = TracedTensor::from_vec_col_major(
vec![2, 2],
vec![4.0_f64, 2.0, 2.0, 3.0],
)
.unwrap();
let l = a.cholesky().unwrap();
let mut compiler = GraphCompiler::new();
let program = compiler.compile(&l).unwrap();
let mut executor = GraphExecutor::new(CpuBackend::new());
executor.register_extension(tenferro_linalg::register_runtime).unwrap();
let out = executor.run(&program).unwrap();
assert_eq!(out.shape(), &[2, 2]);Re-exports§
pub use backend::LinalgBackend;
Modules§
Structs§
- Linalg
AdOutput Support - AD support status for one output of a linalg operation.
- Linalg
AdSupport - AD support manifest entry for one linalg operation.
Enums§
- Linalg
AdOp Kind - Operation keys covered by the linalg AD support manifest.
- Linalg
AdRule Support - AD rule support status for a linalg operation or output.
Constants§
Traits§
- Eager
Tensor Linalg Ext - Linear algebra extension methods for
EagerTensor. - Traced
Tensor Linalg Ext - Linear algebra extension methods for
TracedTensor.
Functions§
- ad_
rules - Return the explicit linalg extension AD rule set.
- all_
linalg_ ad_ support - Return the complete linalg AD support manifest.
- linalg_
ad_ support - Return the support manifest entry for one linalg operation kind.
- register_
runtime