pub struct TensorDeduplicator { /* private fields */ }Expand description
Utility for tensor deduplication using content-addressed storage
Implementations§
Source§impl TensorDeduplicator
impl TensorDeduplicator
Sourcepub fn check(&mut self, tensor: &TensorBlock) -> Option<usize>
pub fn check(&mut self, tensor: &TensorBlock) -> Option<usize>
Check if a tensor has been seen before (by CID) Returns the index of the first occurrence if found
Sourcepub fn register(&mut self, tensor: &TensorBlock) -> usize
pub fn register(&mut self, tensor: &TensorBlock) -> usize
Register a tensor and return its index
Sourcepub fn unique_count(&self) -> usize
pub fn unique_count(&self) -> usize
Get the number of unique tensors
Sourcepub fn stats(&self) -> DeduplicationStats
pub fn stats(&self) -> DeduplicationStats
Get deduplication statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TensorDeduplicator
impl RefUnwindSafe for TensorDeduplicator
impl Send for TensorDeduplicator
impl Sync for TensorDeduplicator
impl Unpin for TensorDeduplicator
impl UnwindSafe for TensorDeduplicator
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> 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