pub struct PredictiveSmartCache<T, K>{ /* private fields */ }Expand description
Enhanced smart cache with predictive prefetching
Implementations§
Source§impl<T, K> PredictiveSmartCache<T, K>
impl<T, K> PredictiveSmartCache<T, K>
pub fn new( l1_max_size: usize, l2_max_size: usize, l3_max_size: usize, policy: EvictionPolicy, config: CacheConfig, max_prefetch_size: usize, ) -> Self
Sourcepub fn set_dataset(&mut self, dataset: Arc<dyn Dataset<T>>)
pub fn set_dataset(&mut self, dataset: Arc<dyn Dataset<T>>)
Set the dataset reference for prefetching
Sourcepub fn get(&self, key: &K) -> Option<(Tensor<T>, Tensor<T>)>
pub fn get(&self, key: &K) -> Option<(Tensor<T>, Tensor<T>)>
Get item with predictive prefetching
Sourcepub fn stats(&self) -> CacheStats
pub fn stats(&self) -> CacheStats
Get cache statistics
Sourcepub fn process_prefetch_queue(&self)
pub fn process_prefetch_queue(&self)
Process prefetch queue (should be called periodically)
Auto Trait Implementations§
impl<T, K> Freeze for PredictiveSmartCache<T, K>
impl<T, K> !RefUnwindSafe for PredictiveSmartCache<T, K>
impl<T, K> !Send for PredictiveSmartCache<T, K>
impl<T, K> !Sync for PredictiveSmartCache<T, K>
impl<T, K> Unpin for PredictiveSmartCache<T, K>
impl<T, K> UnsafeUnpin for PredictiveSmartCache<T, K>
impl<T, K> !UnwindSafe for PredictiveSmartCache<T, K>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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