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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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