ferrotensor
The PyTorch-style tensor API of the Ferrotensor workspace: Tensor
with reverse-mode autograd, nn layers, optim optimizers and LR schedules,
safetensors serialize, and a DataLoader. Tensors live on a Device: a GPU
through wgpu (Metal, Vulkan, DX12) with hand-written WGSL kernels, or the CPU,
which needs no GPU and is what the tests use. f32 only.
use *;
let device = best; // GPU if present, else Device::cpu()
let x = from_data;
let w = from_data.requires_grad_;
let y = x.matmul;
y.sum.backward;
println!;
This is examples/quickstart.rs:
Other examples: mlp_two_moons, char_transformer, gpu_matmul_attention,
similarity_search (outputs in docs/use-cases.md).
To see how an op reaches the GPU, read docs/architecture.md;
to add one, docs/writing-a-kernel.md.
FERROTENSOR_RUN_GPU_TESTS=1