Burn Backend
The contract between Burn's tensor API and the backends that execute it
Application code does not use this crate directly: it works with burn::tensor::Tensor and
Device, and Burn dispatches each operation to a backend at runtime. This crate is for code below
that boundary: backend implementations, backend decorators such as autodiff and fusion, and
backend extensions.
It defines:
BackendTypes, which names a backend's tensor primitives and device type.Backendand the operation traits inops, every tensor operation a backend implements.AutodiffBackendadds gradient support.DeviceOps, a backend device and its default dtypes.TensorData,DType,Shapeand the element traits, which describe tensor data independently of any backend.
Operations report device failures as ExecutionError instead of panicking.
Feature Flags
std(default): standard library support. Without it the crate isno_stdwithalloc.cubecl: conversions between Burn and CubeCL types.cubecl-deviceandcubecl-<runtime>: implementDeviceOpsforcubecl::Device.tracing: instrument operations with thetracingcrate.
See the contributor book for how backends fit into Burn's architecture.
Part of the Burn deep learning framework. See the Burn Book and the API documentation.