Skip to main content

Mamba3Caches

Enum Mamba3Caches 

Source
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

Source

pub fn double_ssd(self) -> Option<Mamba3DoubleSsdCaches>

Unwrap to the double-SSD caches, or None if this is the single-SSD variant.

Source

pub fn single_ssd(self) -> Option<Mamba3SingleSsdCaches>

Unwrap to the single-SSD caches, or None if this is the double-SSD variant.

Source

pub fn caches_len(&self) -> usize

Number of per-layer caches (independent of pathway).

Source

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).

Source

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).

Source

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

Source§

type Cache = Mamba3Cache

The per-layer cache element.
Source§

fn slot_count(&self) -> usize

Number of per-(virtual-)layer slots.
Source§

fn into_slots(self) -> Vec<Option<Mamba3Cache>>

Move each slot into an Option so the loop can take without cloning.
Source§

fn from_slots(slots: Vec<Option<Mamba3Cache>>) -> Self

Inverse of Self::into_slots.
Source§

impl Debug for Mamba3Caches

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Mamba3DoubleSsdCaches> for Mamba3Caches

Source§

fn from(caches: Mamba3DoubleSsdCaches) -> Self

Converts to this type from the input type.
Source§

impl From<Mamba3SingleSsdCaches> for Mamba3Caches

Source§

fn from(caches: Mamba3SingleSsdCaches) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.