pub enum Mamba3Caches {
DoubleSsd(Mamba3DoubleSsdCaches),
SingleSsd(Mamba3SingleSsdCaches),
}Expand description
A pathway-tagged bundle of per-layer caches, so a single dispatch entry can accept / return either cache family.
The caches selection infers whether Double-SSD or Single-SSD is used.
If none is specified, this defaults to Self::SingleSsd.
See also crate::mamba3::ssd_path::Mamba3SsdPath.
Variants§
DoubleSsd(Mamba3DoubleSsdCaches)
Caches for the double-ssd pathway.
SingleSsd(Mamba3SingleSsdCaches)
Caches for the single-ssd pathway.
Implementations§
Source§impl Mamba3Caches
impl Mamba3Caches
Sourcepub fn double_ssd(self) -> Option<Mamba3DoubleSsdCaches>
pub fn double_ssd(self) -> Option<Mamba3DoubleSsdCaches>
Unwrap to the double-SSD caches, or None if this is the single-SSD variant.
Sourcepub fn single_ssd(self) -> Option<Mamba3SingleSsdCaches>
pub fn single_ssd(self) -> Option<Mamba3SingleSsdCaches>
Unwrap to the single-SSD caches, or None if this is the double-SSD variant.
Sourcepub fn caches_len(&self) -> usize
pub fn caches_len(&self) -> usize
Number of per-layer caches (independent of pathway).
Sourcepub fn from_vec(vec: Vec<Mamba3Cache>) -> Self
pub fn from_vec(vec: Vec<Mamba3Cache>) -> Self
Collect per-layer caches into a pathway-tagged bundle. The pathway is inferred from the first element (an empty vec implies single-SSD).
Sourcepub fn into_options(self) -> Vec<Option<Mamba3Cache>>
pub fn into_options(self) -> Vec<Option<Mamba3Cache>>
Wrap each per-layer cache in Some so the loop can take it without
cloning (Burn tensors are reference-counted).
Sourcepub fn from_options(options: Vec<Option<Mamba3Cache>>) -> Self
pub fn from_options(options: Vec<Option<Mamba3Cache>>) -> Self
Inverse of Self::into_options: unwrap each slot and re-bundle.
Trait Implementations§
Source§impl CacheStack for Mamba3Caches
impl CacheStack for Mamba3Caches
Source§type Cache = Mamba3Cache
type Cache = Mamba3Cache
Source§fn slot_count(&self) -> usize
fn slot_count(&self) -> usize
Source§fn into_slots(self) -> Vec<Option<Mamba3Cache>>
fn into_slots(self) -> Vec<Option<Mamba3Cache>>
Option so the loop can take without cloning.Source§fn from_slots(slots: Vec<Option<Mamba3Cache>>) -> Self
fn from_slots(slots: Vec<Option<Mamba3Cache>>) -> Self
Self::into_slots.