Trait BackendDevice

Source
pub trait BackendDevice:
    Sized
    + Debug
    + Clone {
    type Storage: BackendStorage;

    // Required methods
    fn new(_: usize) -> Result<Self>;
    fn location(&self) -> DeviceLocation;
    fn same_device(&self, _: &Self) -> bool;
    fn zeros_impl(&self, _shape: &Shape, _dtype: DType) -> Result<Self::Storage>;
    fn ones_impl(&self, _shape: &Shape, _dtype: DType) -> Result<Self::Storage>;
    fn storage_from_cpu_storage(&self, _: &CpuStorage) -> Result<Self::Storage>;
    fn rand_uniform(
        &self,
        _: &Shape,
        _: DType,
        _: f64,
        _: f64,
    ) -> Result<Self::Storage>;
    fn rand_normal(
        &self,
        _: &Shape,
        _: DType,
        _: f64,
        _: f64,
    ) -> Result<Self::Storage>;
    fn set_seed(&self, _: u64) -> Result<()>;
}

Required Associated Types§

Required Methods§

Source

fn new(_: usize) -> Result<Self>

Source

fn location(&self) -> DeviceLocation

Source

fn same_device(&self, _: &Self) -> bool

Source

fn zeros_impl(&self, _shape: &Shape, _dtype: DType) -> Result<Self::Storage>

Source

fn ones_impl(&self, _shape: &Shape, _dtype: DType) -> Result<Self::Storage>

Source

fn storage_from_cpu_storage(&self, _: &CpuStorage) -> Result<Self::Storage>

Source

fn rand_uniform( &self, _: &Shape, _: DType, _: f64, _: f64, ) -> Result<Self::Storage>

Source

fn rand_normal( &self, _: &Shape, _: DType, _: f64, _: f64, ) -> Result<Self::Storage>

Source

fn set_seed(&self, _: u64) -> Result<()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§