Trait candle_core::backend::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>;
}Required Associated Types§
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>
Object Safety§
This trait is not object safe.