AD-aware tensor interface layer on top of tenferro-rs.
This repository currently provides:
- Generic AD value model:
AdValue<T>AdScalar<T>AdTensor<T>
- Runtime dtype wrappers:
DynScalar,DynTensorDynAdValue,DynAdTensorScalarType(F32,F64,C32,C64)
- AD boundary traits:
Differentiable,TensorKernel,OpRule
- Runtime context:
RuntimeContextset_default_runtimewith_default_runtime
- Builder-style operation API (
run()terminal):- Einsum:
einsum(...),einsum_ad(...) - Linalg primal:
svd/qr/lu/eigen/lstsq/cholesky/solve/inv/det/slogdet/eig/pinv/matrix_exp/solve_triangular/norm - Linalg AD: corresponding
*_ad(...)operations
- Einsum:
All operation entry points are builder-based and execute via .run() using
the default runtime context.
use ad_tensors_rs::{qr, set_default_runtime, RuntimeContext};
use tenferro_prims::CpuContext;
use tenferro_tensor::{MemoryOrder, Tensor};
let _guard = set_default_runtime(RuntimeContext::Cpu(CpuContext::new(1)));
let a = Tensor::<f64>::from_slice(&[1.0, 0.0, 0.0, 1.0], &[2, 2], MemoryOrder::ColumnMajor)?;
let qr_result = qr(&a).run()?;
# Ok::<(), ad_tensors_rs::Error>(())cargo fmt --all
cargo clippy --workspace
cargo test --release --workspaceBuild local docs site:
./scripts/build_docs_site.shOutput:
target/docs-site/index.html(top page)target/docs-site/api/(cargo doc --workspace --no-depsoutput)target/docs-site/design/(rendered design docs)
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.