luma-tensor
A tensor computation library with compile-time kind separation (Float/Int/Bool), runtime precision, a Cpu/Cuda device abstraction, and tape-based autograd.
Usage
use FloatDType;
use ;
// construct a 2×3 tensor and do a matmul
let x = from_slice.unwrap;
let xt = x.transpose.unwrap;
let y = x.matmul.unwrap;
println!;
Autograd
use FloatDType;
use ;
let x = from_slice.unwrap;
x.set_requires_grad;
let y = x.mul.unwrap.sum_all.unwrap;
let grads = y.backward.unwrap;
let gx = grads.get_by_id.unwrap;
assert_eq!;
Cuda
use FloatDType;
use ;
let dev = new.unwrap;
let x = from_slice.unwrap;
License
MIT — see LICENSE.