pub struct SparseMemoryStats {
pub dense_parameters: usize,
pub sparse_parameters: usize,
pub bias_parameters: usize,
pub dense_memory_bytes: usize,
pub sparse_memory_bytes: usize,
pub memory_reduction: f32,
}
Expand description
Memory usage statistics for sparse linear layer
Fields§
§dense_parameters: usize
Number of parameters in equivalent dense layer
sparse_parameters: usize
Number of non-zero parameters in sparse layer
bias_parameters: usize
Number of bias parameters
dense_memory_bytes: usize
Memory usage of equivalent dense layer (bytes)
sparse_memory_bytes: usize
Memory usage of sparse layer (bytes)
memory_reduction: f32
Memory reduction factor (0.0 to 1.0)
Implementations§
Source§impl SparseMemoryStats
impl SparseMemoryStats
Sourcepub fn compression_ratio(&self) -> f32
pub fn compression_ratio(&self) -> f32
Get compression ratio
Sourcepub fn efficiency_score(&self) -> f32
pub fn efficiency_score(&self) -> f32
Get efficiency score
Trait Implementations§
Source§impl Clone for SparseMemoryStats
impl Clone for SparseMemoryStats
Source§fn clone(&self) -> SparseMemoryStats
fn clone(&self) -> SparseMemoryStats
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 SparseMemoryStats
impl RefUnwindSafe for SparseMemoryStats
impl Send for SparseMemoryStats
impl Sync for SparseMemoryStats
impl Unpin for SparseMemoryStats
impl UnwindSafe for SparseMemoryStats
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