Expand description
The operation vocabulary oxmera backends implement.
The trait and enums are defined in oxmera-tensor (they must live with
Tensor so its methods and std::ops overloads can dispatch under the
orphan rule); this crate re-exports them as the stable, documented
vocabulary for backend authors.
Semantics every backend must honor:
- Binary elementwise operations broadcast per
oxmera_core::shape::broadcast_shapes. - Operands must share a device and dtype; violations are typed errors, never coercions.
- The output of every operation is a fresh contiguous tensor on the operands’ device.
- The CPU backend defines correct answers; every other backend is validated against it within floating-point tolerance.
Structs§
- Matmul
Plan - The shape contract of a matmul, resolved once so every backend agrees.
Enums§
- Binary
Op - Elementwise binary operations with NumPy broadcasting.
f32only. - Reduce
Op - Reductions along axes.
f32only. - UnaryOp
- Elementwise unary operations. Float (
f32) tensors only.
Traits§
- Backend
- A complete backend: every primitive the tensor method layer dispatches.
Functions§
- backend_
for - The backend serving
device, or a typed error when none is registered. - plan_
matmul - Resolve the matmul contract for two shapes, or the typed error a caller sees for incompatible operands.
- register_
backend - Register a backend for its device, replacing any previous registration.
- registered_
devices - Every registered device, sorted for stable reporting.