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§

fn cache_to_inner(c: Mamba3Cache) -> Mamba3Cache

Move one cache slot to the inner (non-autodiff) backend. Read more
Source§

fn cache_from_inner(c: Mamba3Cache) -> Mamba3Cache

Lift one cache slot back from the inner backend, as a fresh graph root. The inverse of Self::cache_to_inner; see its notes.
Source§

impl Clone for Mamba3Caches

Source§

fn clone(&self) -> Mamba3Caches

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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.