Skip to main content

Crate oxmera_tensor

Crate oxmera_tensor 

Source
Expand description

The oxmera tensor: shared storage viewed through a layout, with multi-device backends and reverse-mode autograd.

This crate is the hub of the framework:

  • Tensor — the value type: constructors, zero-copy strided views, element access, and the full differentiable op surface (add, matmul, softmax, …) plus std::ops operator sugar.
  • einsum — Einstein-summation contractions lowered onto matmul, permute and sum.
  • Small batched linear algebra on Tensor: eye, diag, diag_embed, trace, cholesky, logdet, det, eigh.
  • backend — the op vocabulary (backend::UnaryOp, backend::BinaryOp, backend::ReduceOp), the backend::Backend trait every device implements, and the registry that resolves a oxmera_core::Device handle. The traits live here so tensor methods and operator overloads can dispatch without violating the orphan rule.
  • autograd — the tape: recording switch, autograd::no_grad, and gradient propagation; Tensor::backward drives it.

Backends register themselves at load time (linking oxmera-cpu or oxmera-metal is what makes their device usable); the oxmera umbrella crate links every backend for the current platform.

Re-exports§

pub use autograd::NoGradGuard;
pub use autograd::no_grad;
pub use backend::Backend;
pub use backend::BinaryOp;
pub use backend::ReduceOp;
pub use backend::UnaryOp;
pub use backend::backend_for;
pub use backend::register_backend;
pub use storage::CpuStorage;
pub use storage::OpaqueBuffer;
pub use storage::Storage;
pub use storage::StorageData;
pub use tensor::Tensor;

Modules§

autograd
Reverse-mode autograd plumbing: the tape nodes tensors carry, gradient accumulation, and the recording switch.
backend
The backend seam: the op vocabulary every device implements, and the registry that resolves a Device handle to an implementation.
cpu
The multi-threaded CPU backend implementation. Lives inside the tensor crate so it can be registered lazily by backend_for — the CPU reference is always available, with no link-order or life-before-main caveats. The public face is the oxmera-cpu crate.
ops
The differentiable operation layer: every method dispatches to the device backend for the forward pass and, when recording is on and an input is tracked, attaches the exact vector-Jacobian product to the output’s tape node.
overload
std::ops sugar for tensors.
storage
Storage: the owned buffer behind one or more tensors.
tensor
The tensor value: a layout over shared storage, with an optional autograd tape node.

Constants§

CAPABILITIES
What this crate can do, for oxmera doctor.
EIGH_SYMMETRY_TOL
How far from symmetric an Tensor::eigh input may be, relative to its own largest magnitude.

Functions§

einsum
Einstein summation over one or two operands. See the module docs for the accepted specs.