pub enum MambaVocabNet {
Mamba1(VocabNetwork<Mamba1>),
Mamba2(VocabNetwork<Mamba2>),
Mamba3(VocabNetwork<Mamba3>),
}Expand description
A runtime-selectable token language model: the same Embedding → Layers → norm_f → LM head shape over any Mamba-x family, chosen at runtime. The
vocabulary counterpart of MambaLatentNet.
Variants§
Mamba1(VocabNetwork<Mamba1>)
Mamba-1 language model.
Mamba2(VocabNetwork<Mamba2>)
Mamba-2 language model.
Mamba3(VocabNetwork<Mamba3>)
Mamba-3 language model.
Implementations§
Source§impl MambaVocabNet
impl MambaVocabNet
Sourcepub fn forward(
&self,
x: Tensor<2, Int>,
caches: Option<MambaCaches>,
ssd_path: MambaSsdPath,
) -> (Tensor<3>, MambaCaches)
pub fn forward( &self, x: Tensor<2, Int>, caches: Option<MambaCaches>, ssd_path: MambaSsdPath, ) -> (Tensor<3>, MambaCaches)
Full-sequence pass: token IDs [batch, sequence] → logits
[batch, sequence, padded_vocab]. The ssd_path/caches family must
match the network; a mismatch is a caller error and panics.
Sourcepub fn step(
&self,
x: Tensor<1, Int>,
caches: Option<MambaCaches>,
layers_own_index: Option<&mut usize>,
layer_indices: Option<&mut Vec<usize>>,
) -> (Tensor<2>, MambaCaches)
pub fn step( &self, x: Tensor<1, Int>, caches: Option<MambaCaches>, layers_own_index: Option<&mut usize>, layer_indices: Option<&mut Vec<usize>>, ) -> (Tensor<2>, MambaCaches)
Single-token step: token IDs [batch] → logits [batch, padded_vocab].
Cache family must match the network. The two inner Layers class
cursors (layers_own_index, layer_indices) are forwarded — see
VocabNetwork::step.
Sourcepub fn step_infinite(&self, x: Tensor<1, Int>) -> Tensor<2>
pub fn step_infinite(&self, x: Tensor<1, Int>) -> Tensor<2>
Stationary fixed point under a constant token (no caches) — see
VocabNetwork::step_infinite. Only the Mamba-3 family implements the
closed form; the other variants panic.
Sourcepub fn step_n_approx(
&self,
x: Tensor<1, Int>,
n: usize,
caches: Option<MambaCaches>,
) -> (Tensor<2>, MambaCaches)
pub fn step_n_approx( &self, x: Tensor<1, Int>, n: usize, caches: Option<MambaCaches>, ) -> (Tensor<2>, MambaCaches)
Approximate jump of n consecutive constant-token steps — see
VocabNetwork::step_n_approx. Cache family must match the network;
only the Mamba-3 family implements the closed form (others panic).