#[cfg(feature = "fusion")]
pub use burn_fusion as fusion;
#[cfg(feature = "ir")]
pub use burn_ir as ir;
pub use burn_backend::*;
pub use burn_backend_extension::{ExtensionType, backend_extension};
pub use burn_dispatch::{backend::*, device::*, tensor::*};
#[allow(unused_imports)] pub use burn_dispatch::backends::*;
#[allow(unused_imports)]
pub use burn_dispatch::devices::*;
#[cfg(feature = "cpu")]
pub use burn_cpu::{self as cpu, Cpu};
#[cfg(feature = "cuda")]
pub use burn_cuda::{self as cuda, Cuda};
#[cfg(feature = "rocm")]
pub use burn_rocm::{self as rocm, Rocm};
#[cfg(feature = "metal")]
pub use burn_wgpu::Metal;
#[cfg(feature = "vulkan")]
pub use burn_wgpu::Vulkan;
#[cfg(feature = "webgpu")]
pub use burn_wgpu::WebGpu;
#[cfg(feature = "wgpu")]
pub use burn_wgpu::{self as wgpu, Wgpu};
pub trait ExtensionType<B: Backend> {
type Target;
fn map_to_dispatch<F>(self, map_kind: F, autodiff: DispatchAutodiffContext) -> Self::Target
where
F: Fn(BackendTensor<B>) -> DispatchTensorKind;
fn map_from_dispatch<F>(target: Self::Target, unwrap_kind: F) -> Self
where
F: Fn(DispatchTensor) -> BackendTensor<B>;
fn routing_tensor(target: &Self::Target) -> Option<&DispatchTensor>;
fn routing_float_tensor(target: &Self::Target) -> Option<&DispatchTensor>;
#[doc(hidden)]
fn autodiff_context(target: &Self::Target) -> DispatchAutodiffContext {
Self::routing_tensor(target)
.map(|tensor| tensor.autodiff)
.unwrap_or_default()
}
}