pub struct SparsityStats {
pub actual_sparsity: f64,
pub zero_count: usize,
pub total_count: usize,
pub theoretical_speedup: f64,
pub pattern: SparsityPattern,
}Expand description
Statistics about the sparsity of a pruned tensor.
Fields§
§actual_sparsity: f64Fraction of zero elements (0.0 = dense, 1.0 = all-zero).
zero_count: usizeNumber of zero elements.
total_count: usizeTotal number of elements.
theoretical_speedup: f64Theoretical compute speedup from sparsity (rough estimate).
pattern: SparsityPatternPattern used for pruning.
Implementations§
Source§impl SparsityStats
impl SparsityStats
Sourcepub fn compute(tensor: &ArrayD<f64>, pattern: SparsityPattern) -> Self
pub fn compute(tensor: &ArrayD<f64>, pattern: SparsityPattern) -> Self
Compute sparsity statistics for a tensor with the given pattern.
Trait Implementations§
Source§impl Clone for SparsityStats
impl Clone for SparsityStats
Source§fn clone(&self) -> SparsityStats
fn clone(&self) -> SparsityStats
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 SparsityStats
impl RefUnwindSafe for SparsityStats
impl Send for SparsityStats
impl Sync for SparsityStats
impl Unpin for SparsityStats
impl UnsafeUnpin for SparsityStats
impl UnwindSafe for SparsityStats
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