pub struct MemoryStats {
pub total_bytes: usize,
pub element_size: usize,
pub total_elements: usize,
pub overhead_bytes: usize,
pub is_memory_mapped: bool,
}Expand description
Memory usage statistics for a tensor
Fields§
§total_bytes: usizeTotal memory used by tensor data in bytes
element_size: usizeSize of each element in bytes
total_elements: usizeTotal number of elements
overhead_bytes: usizeMemory overhead from storage structures
is_memory_mapped: boolWhether tensor uses memory-mapped storage
Implementations§
Source§impl MemoryStats
impl MemoryStats
Sourcepub fn effective_bytes(&self) -> usize
pub fn effective_bytes(&self) -> usize
Get effective memory usage (data + overhead)
Sourcepub fn efficiency(&self) -> f64
pub fn efficiency(&self) -> f64
Get memory efficiency (data bytes / total bytes)
Trait Implementations§
Source§impl Clone for MemoryStats
impl Clone for MemoryStats
Source§fn clone(&self) -> MemoryStats
fn clone(&self) -> MemoryStats
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 moreAuto Trait Implementations§
impl Freeze for MemoryStats
impl RefUnwindSafe for MemoryStats
impl Send for MemoryStats
impl Sync for MemoryStats
impl Unpin for MemoryStats
impl UnwindSafe for MemoryStats
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> 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