pub enum MambaLatentNet {
Mamba1(LatentNetwork<Mamba1>),
Mamba2(LatentNetwork<Mamba2>),
Mamba3(LatentNetwork<Mamba3>),
}Expand description
A runtime-selectable latent network: the same in_proj → Layers → out_proj
shape over any Mamba-x family, chosen at runtime.
Variants§
Mamba1(LatentNetwork<Mamba1>)
Mamba-1 latent network.
Mamba2(LatentNetwork<Mamba2>)
Mamba-2 latent network.
Mamba3(LatentNetwork<Mamba3>)
Mamba-3 latent network.
Implementations§
Source§impl MambaLatentNet
impl MambaLatentNet
Sourcepub fn forward(
&self,
x: Tensor<3>,
caches: Option<MambaCaches>,
ssd_path: MambaSsdPath,
) -> (Tensor<3>, MambaCaches)
pub fn forward( &self, x: Tensor<3>, caches: Option<MambaCaches>, ssd_path: MambaSsdPath, ) -> (Tensor<3>, MambaCaches)
Full-sequence pass. The ssd_path must match the network’s family; a
mismatch is a caller error and panics with an explanatory message.
Sourcepub fn step(
&self,
x: Tensor<2>,
caches: Option<MambaCaches>,
own_index: Option<&mut usize>,
layers_own_index: Option<&mut usize>,
layer_indices: Option<&mut Vec<usize>>,
) -> (Tensor<2>, MambaCaches)
pub fn step( &self, x: Tensor<2>, caches: Option<MambaCaches>, own_index: Option<&mut usize>, layers_own_index: Option<&mut usize>, layer_indices: Option<&mut Vec<usize>>, ) -> (Tensor<2>, MambaCaches)
Single-token step. No path argument (decoding is recurrent for all
families). Cache family must match the network. The three class cursors
(own_index for the network’s class tokens, layers_own_index for the
stack-level class latents, layer_indices for the per-virtual-layer
vector) are threaded to the inner network — see LatentNetwork::step.
Sourcepub fn step_infinite(&self, x: Tensor<2>) -> Tensor<2>
pub fn step_infinite(&self, x: Tensor<2>) -> Tensor<2>
Stationary fixed point under a constant token (no caches) — see
LatentNetwork::step_infinite. Only the Mamba-3 family implements the
closed form; the other variants panic.
Sourcepub fn step_n_approx(
&self,
x: Tensor<2>,
n: usize,
caches: Option<MambaCaches>,
) -> (Tensor<2>, MambaCaches)
pub fn step_n_approx( &self, x: Tensor<2>, n: usize, caches: Option<MambaCaches>, ) -> (Tensor<2>, MambaCaches)
Approximate jump of n consecutive constant-token steps — see
LatentNetwork::step_n_approx. Cache family must match the network;
only the Mamba-3 family implements the closed form (others panic).