Expand description
Burn multi-backend dispatch.
§Available Backends
The dispatch backend supports the following variants, each enabled via cargo features:
| Backend | Feature | Description |
|---|---|---|
Cube | cpu, cuda, metal, rocm, vulkan, webgpu, wgpu | Every cubecl runtime. One backend: the features decide which runtimes are compiled in, and a tensor’s device says which one it runs on |
Flex | flex | Pure Rust CPU backend using burn-flex |
NdArray | ndarray | Pure Rust CPU backend using ndarray (deprecated - use flex) |
LibTorch | tch | Libtorch backend via tch (deprecated - use a CubeCL backend) |
Autodiff | autodiff | Autodiff-enabled backend (used in combination with any of the backends above) |
Note: The features can be combined freely. The cubecl-backed ones all
select the same backend, so they share the one DispatchDevice::Cube
variant — enabling several compiles several runtimes in, and the device a
tensor carries is what picks between them.