TenRSo - Tensor Computing Stack for COOLJAPAN
Production-grade tensor operations with generalized contraction, decompositions, sparse formats, and out-of-core processing.
Version: 0.1.0-alpha.2 Status: Production-ready alpha release with 1,820+ tests passing
This is the meta crate that re-exports all TenRSo components for convenient access.
Quick Start
use *;
// Create a 3D tensor
let tensor = zeros;
assert_eq!;
// Perform CP decomposition
// let cp = cp_als(&tensor, 64, 50, 1e-4, InitStrategy::Random)?;
# Ok::
Components
Core Tensor Operations ([core])
Dense tensor types, axis metadata, views, reshape/permute, unfold/fold.
use DenseND;
let tensor = ones;
let reshaped = tensor.reshape.unwrap;
assert_eq!;
Tensor Kernels ([kernels])
Khatri-Rao, Kronecker, Hadamard, n-mode products, MTTKRP.
use tenrso::kernels::khatri_rao;
use scirs2_core::ndarray_ext::Array2;
let a = Array2::<f64>::ones((10, 5));
let b = Array2::<f64>::ones((8, 5));
let kr = khatri_rao(&a.view(), &b.view());
assert_eq!(kr.shape(), &[80, 5]);
Tensor Decompositions ([decomp])
CP-ALS, Tucker-HOOI/HOSVD, TT-SVD decomposition algorithms.
use ;
use DenseND;
let tensor = random_uniform;
let cp = cp_als.unwrap;
println!;
Sparse Tensors ([sparse])
COO, CSR, BCSR, CSC formats and sparse operations.
use CooTensor;
let indices = vec!;
let values = vec!;
let shape = vec!;
let coo = new.unwrap;
assert_eq!;
Contraction Planning ([planner])
Contraction order optimization and representation selection.
use ;
let spec = parse.unwrap;
let shapes = vec!;
let hints = default;
let plan = greedy_planner.unwrap;
println!;
Out-of-Core Processing ([ooc])
Arrow/Parquet I/O, memory-mapped arrays, chunked execution.
Available when the ooc feature is enabled (default).
Unified Execution ([exec])
High-level einsum API with automatic optimization.
use ;
use ;
let a = from_vec.unwrap;
let b = from_vec.unwrap;
let handle_a = from_dense_auto;
let handle_b = from_dense_auto;
let result =
.inputs
.run
.unwrap;
# assert_eq!;
Automatic Differentiation
Custom VJP/grad rules for tensor operations (available via the ad module).
Available when the ad feature is enabled.
Features
ooc(default): Enable out-of-core processing (Arrow, Parquet, mmap)ad: Enable automatic differentiation supportfull: Enable all features
Examples
See the examples/ directory for comprehensive usage demonstrations.
Performance
TenRSo is optimized for production use:
- SIMD acceleration via SciRS2-core
- Parallel execution for large problems
- Cache-efficient blocking and tiling
- Zero-copy views and operations