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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more