pub struct CpuStorage { /* private fields */ }Expand description
CPU tensor storage implementation
Implementations§
Trait Implementations§
Source§impl Clone for CpuStorage
impl Clone for CpuStorage
Source§impl Debug for CpuStorage
impl Debug for CpuStorage
Source§impl TensorStorage for CpuStorage
impl TensorStorage for CpuStorage
Source§fn data_ptr_mut(&mut self) -> *mut u8
fn data_ptr_mut(&mut self) -> *mut u8
Get mutable data pointer (for unsafe operations)
Source§fn size_bytes(&self) -> usize
fn size_bytes(&self) -> usize
Get data size in bytes
Source§fn to_device(&self, device: &Device) -> Result<Arc<dyn TensorStorage>>
fn to_device(&self, device: &Device) -> Result<Arc<dyn TensorStorage>>
Copy data to another device
Source§fn clone_storage(&self) -> Arc<dyn TensorStorage> ⓘ
fn clone_storage(&self) -> Arc<dyn TensorStorage> ⓘ
Clone the storage
Source§fn as_candle_tensor(&self) -> Option<&CandleTensor>
fn as_candle_tensor(&self) -> Option<&CandleTensor>
Try to get the underlying Candle tensor (if this is CandleStorage)
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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