pub trait Backend: TensorOps<Self> + ModuleOps<Self> + Clone + Sized + Default + Send + Sync + Debug + 'static {
type Device: Copy + Clone + Default + Debug + Send + Sync;
type Elem: Element;
type FullPrecisionElem: Element;
type FullPrecisionBackend: Backend<Elem = Self::FullPrecisionElem, Device = Self::Device>;
type IntegerBackend: Backend<Elem = i64, Device = Self::Device>;
type TensorPrimitive<const D: usize>: Add<Self::TensorPrimitive<D>, Output = Self::TensorPrimitive<D>> + Zeros + Ones + Clone + Send + Sync + 'static + Debug;
type BoolTensorPrimitive<const D: usize>: Clone + Send + Sync + 'static + Debug;
fn from_data<const D: usize>(
data: Data<Self::Elem, D>,
device: Self::Device
) -> Self::TensorPrimitive<D>;
fn from_data_bool<const D: usize>(
data: Data<bool, D>,
device: Self::Device
) -> Self::BoolTensorPrimitive<D>;
fn ad_enabled() -> bool;
fn name() -> String;
fn seed(seed: u64);
fn random<const D: usize>(
shape: Shape<D>,
distribution: Distribution<Self::Elem>,
device: Self::Device
) -> Self::TensorPrimitive<D>;
fn zeros<const D: usize>(
shape: Shape<D>,
device: Self::Device
) -> Self::TensorPrimitive<D> { ... }
fn ones<const D: usize>(
shape: Shape<D>,
device: Self::Device
) -> Self::TensorPrimitive<D> { ... }
}