pub struct BlockSparsityStats {
pub total_blocks: usize,
pub nnz_blocks: usize,
pub sparsity: f64,
pub density: f64,
pub memory_bytes: usize,
pub theoretical_dense_bytes: usize,
pub compression_ratio: f64,
pub avg_block_norm: f64,
pub max_block_norm: f64,
}Expand description
Detailed statistics about the block-level sparsity of a BSR tensor.
Fields§
§total_blocks: usizeTotal number of possible blocks.
nnz_blocks: usizeNumber of stored (non-zero) blocks.
sparsity: f64Fraction of blocks that are zero (1 − density).
density: f64Fraction of blocks that are non-zero (1 − sparsity).
memory_bytes: usizeActual memory used by the BSR representation (bytes).
theoretical_dense_bytes: usizeMemory a fully dense f64 matrix would require (bytes).
compression_ratio: f64theoretical_dense_bytes / memory_bytes. Values > 1.0 indicate savings.
avg_block_norm: f64Mean Frobenius norm of stored blocks.
max_block_norm: f64Maximum Frobenius norm among stored blocks.
Implementations§
Source§impl BlockSparsityStats
impl BlockSparsityStats
Sourcepub fn compute(tensor: &BlockedSparseTensor) -> Self
pub fn compute(tensor: &BlockedSparseTensor) -> Self
Compute statistics for the given BSR tensor.
Trait Implementations§
Source§impl Clone for BlockSparsityStats
impl Clone for BlockSparsityStats
Source§fn clone(&self) -> BlockSparsityStats
fn clone(&self) -> BlockSparsityStats
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 BlockSparsityStats
impl RefUnwindSafe for BlockSparsityStats
impl Send for BlockSparsityStats
impl Sync for BlockSparsityStats
impl Unpin for BlockSparsityStats
impl UnsafeUnpin for BlockSparsityStats
impl UnwindSafe for BlockSparsityStats
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