Struct candle_core::cpu_backend::CpuDevice
source · pub struct CpuDevice;
Trait Implementations§
source§impl BackendDevice for CpuDevice
impl BackendDevice for CpuDevice
type Storage = CpuStorage
fn location(&self) -> DeviceLocation
fn same_device(&self, _: &Self) -> bool
fn storage_from_slice<T: WithDType>(&self, s: &[T]) -> Result<Self::Storage>
fn storage_from_cpu_storage(&self, s: &CpuStorage) -> Result<Self::Storage>
fn storage_from_cpu_storage_owned(&self, s: CpuStorage) -> Result<Self::Storage>
fn new(_: usize) -> Result<Self>
fn set_seed(&self, _seed: u64) -> Result<()>
fn rand_uniform( &self, shape: &Shape, dtype: DType, min: f64, max: f64 ) -> Result<CpuStorage>
fn rand_normal( &self, shape: &Shape, dtype: DType, mean: f64, std: f64 ) -> Result<CpuStorage>
source§unsafe fn alloc_uninit(&self, shape: &Shape, dtype: DType) -> Result<CpuStorage>
unsafe fn alloc_uninit(&self, shape: &Shape, dtype: DType) -> Result<CpuStorage>
Safety Read more
fn ones_impl(&self, shape: &Shape, dtype: DType) -> Result<CpuStorage>
fn zeros_impl(&self, shape: &Shape, dtype: DType) -> Result<CpuStorage>
source§fn synchronize(&self) -> Result<()>
fn synchronize(&self) -> Result<()>
Synchronize should block until all the operations on the device are completed.
Auto Trait Implementations§
impl Freeze for CpuDevice
impl RefUnwindSafe for CpuDevice
impl Send for CpuDevice
impl Sync for CpuDevice
impl Unpin for CpuDevice
impl UnwindSafe for CpuDevice
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more