pub struct Mamba2BidiLayersConfig {
pub n_real_layers: usize,
pub n_virtual_layers: Option<(usize, BidiSchedule)>,
pub mamba_block: Mamba2Config,
pub ignore_first_residual: bool,
pub ignore_last_residual: bool,
pub outputs_merge: Vec<OutputMergeConfig>,
}Fields§
§n_real_layers: usize§n_virtual_layers: Option<(usize, BidiSchedule)>§mamba_block: Mamba2Config§ignore_first_residual: bool§ignore_last_residual: bool§outputs_merge: Vec<OutputMergeConfig>§Shape
- [n_real_layers / 2]
Implementations§
Source§impl Mamba2BidiLayersConfig
impl Mamba2BidiLayersConfig
Sourcepub fn new(
n_real_layers: usize,
mamba_block: Mamba2Config,
outputs_merge: Vec<OutputMergeConfig>,
) -> Self
pub fn new( n_real_layers: usize, mamba_block: Mamba2Config, outputs_merge: Vec<OutputMergeConfig>, ) -> Self
Source§impl Mamba2BidiLayersConfig
impl Mamba2BidiLayersConfig
Sourcepub fn with_n_virtual_layers(
self,
n_virtual_layers: Option<(usize, BidiSchedule)>,
) -> Self
pub fn with_n_virtual_layers( self, n_virtual_layers: Option<(usize, BidiSchedule)>, ) -> Self
Sets the value for the field n_virtual_layers.
- 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.
- 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.
- Defaults to
false
Source§impl Mamba2BidiLayersConfig
impl Mamba2BidiLayersConfig
Sourcepub fn init<B: Backend>(&self, device: &B::Device) -> Mamba2BidiLayers<B>
pub fn init<B: Backend>(&self, device: &B::Device) -> Mamba2BidiLayers<B>
Returns the initialized model.
Trait Implementations§
Source§impl Clone for Mamba2BidiLayersConfig
impl Clone for Mamba2BidiLayersConfig
Source§impl Config for Mamba2BidiLayersConfig
impl Config for Mamba2BidiLayersConfig
§fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
Loads the configuration from a binary buffer. Read more
Source§impl Debug for Mamba2BidiLayersConfig
impl Debug for Mamba2BidiLayersConfig
Source§impl<'de> Deserialize<'de> for Mamba2BidiLayersConfig
impl<'de> Deserialize<'de> for Mamba2BidiLayersConfig
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for Mamba2BidiLayersConfig
impl Display for Mamba2BidiLayersConfig
Auto Trait Implementations§
impl Freeze for Mamba2BidiLayersConfig
impl RefUnwindSafe for Mamba2BidiLayersConfig
impl Send for Mamba2BidiLayersConfig
impl Sync for Mamba2BidiLayersConfig
impl Unpin for Mamba2BidiLayersConfig
impl UnsafeUnpin for Mamba2BidiLayersConfig
impl UnwindSafe for Mamba2BidiLayersConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more