pub struct Mamba3LayersConfig {
pub n_real_layers: usize,
pub n_virtual_layers: Option<(usize, Schedule)>,
pub mamba_block: Mamba3Config,
pub ignore_first_residual: bool,
pub ignore_last_residual: bool,
}Expand description
Configuration / factory for Mamba3Layers.
Fields§
§n_real_layers: usizeNumber of distinct weight sets to allocate.
n_virtual_layers: Option<(usize, Schedule)>Optional virtual-layer scheduling. See Mamba3Layers for details.
mamba_block: Mamba3ConfigConfiguration shared by all Mamba-3 blocks in the stack.
ignore_first_residual: bool§ignore_last_residual: boolImplementations§
Source§impl Mamba3LayersConfig
impl Mamba3LayersConfig
Sourcepub fn new(n_real_layers: usize, mamba_block: Mamba3Config) -> Self
pub fn new(n_real_layers: usize, mamba_block: Mamba3Config) -> Self
Create a new instance of the config.
§Arguments
§Required Arguments
§n_real_layers
Number of distinct weight sets to allocate.
§mamba_block
Configuration shared by all Mamba-3 blocks in the stack.
§Default Arguments
§n_virtual_layers
Optional virtual-layer scheduling. See Mamba3Layers for details.
- Defaults to
"None"
§ignore_first_residual
See Mamba3Layers::ignore_first_residual.
- Defaults to
false
§ignore_last_residual
See Mamba3Layers::ignore_last_residual.
- Defaults to
false
Source§impl Mamba3LayersConfig
impl Mamba3LayersConfig
Sourcepub fn with_n_virtual_layers(
self,
n_virtual_layers: Option<(usize, Schedule)>,
) -> Self
pub fn with_n_virtual_layers( self, n_virtual_layers: Option<(usize, Schedule)>, ) -> Self
Sets the value for the field n_virtual_layers.
Optional virtual-layer scheduling. See Mamba3Layers for details.
- Defaults to
"None"
Sourcepub fn with_ignore_first_residual(self, ignore_first_residual: bool) -> Self
pub fn with_ignore_first_residual(self, ignore_first_residual: bool) -> Self
Sets the value for the field ignore_first_residual.
See Mamba3Layers::ignore_first_residual.
- Defaults to
false
Sourcepub fn with_ignore_last_residual(self, ignore_last_residual: bool) -> Self
pub fn with_ignore_last_residual(self, ignore_last_residual: bool) -> Self
Sets the value for the field ignore_last_residual.
See Mamba3Layers::ignore_last_residual.
- Defaults to
false
Source§impl Mamba3LayersConfig
impl Mamba3LayersConfig
Sourcepub fn init<B: Backend>(&self, device: &B::Device) -> Mamba3Layers<B>
pub fn init<B: Backend>(&self, device: &B::Device) -> Mamba3Layers<B>
Allocate and initialise all layers on device.