pub enum CpuStorage {
BF16(Vec<bf16>),
F16(Vec<f16>),
F32(Vec<f32>),
I32(Vec<i32>),
I64(Vec<i64>),
}Variants§
Implementations§
Source§impl CpuStorage
impl CpuStorage
pub fn as_mut_ptr(&mut self) -> *mut c_void
pub fn as_ptr(&mut self) -> *const c_void
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn dtype(&self) -> DType
pub fn as_ref(&self) -> CpuStorageRef<'_>
pub fn as_mut_ref(&mut self) -> CpuStorageRefMut<'_>
pub fn data<T>(&self) -> Result<&[T], Error>where
T: WithDType,
pub fn data_mut<T>(&mut self) -> Result<&mut [T], Error>where
T: WithDType,
Trait Implementations§
Source§impl Clone for CpuStorage
impl Clone for CpuStorage
Source§fn clone(&self) -> CpuStorage
fn clone(&self) -> CpuStorage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CpuStorage
impl Debug for CpuStorage
Source§impl Slice for CpuStorage
impl Slice for CpuStorage
type Device = CpuDevice
fn len(&self) -> usize
fn dtype(&self) -> DType
fn device(&self) -> &<CpuStorage as Slice>::Device
fn copy_host_to_device<DT>(&mut self, src: &[DT]) -> Result<(), Error>where
DT: WithDType,
fn copy_device_to_host<DT>(&self, dst: &mut [DT]) -> Result<(), Error>where
DT: WithDType,
fn is_empty(&self) -> bool
fn to_vec<DT>(&self) -> Result<Vec<DT>, Error>where
DT: WithDType,
Auto Trait Implementations§
impl Freeze for CpuStorage
impl RefUnwindSafe for CpuStorage
impl Send for CpuStorage
impl Sync for CpuStorage
impl Unpin for CpuStorage
impl UnsafeUnpin for CpuStorage
impl UnwindSafe for CpuStorage
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