pub enum MambaBidiLayers {
Mamba1(BidiLayers<Mamba1>),
Mamba2(BidiLayers<Mamba2>),
Mamba3(BidiLayers<Mamba3>),
}Expand description
A runtime-selectable bidirectional stack: the same paired straight/reverse
structure over any Mamba-x family, chosen at runtime. The forward-only
counterpart of MambaLatentNet for non-autoregressive tasks.
Variants§
Mamba1(BidiLayers<Mamba1>)
Mamba-1 bidirectional stack.
Mamba2(BidiLayers<Mamba2>)
Mamba-2 bidirectional stack.
Mamba3(BidiLayers<Mamba3>)
Mamba-3 bidirectional stack.
Implementations§
Source§impl MambaBidiLayers
impl MambaBidiLayers
Sourcepub fn class_latent_output_indices(&self, orig_len: usize) -> Vec<usize>
pub fn class_latent_output_indices(&self, orig_len: usize) -> Vec<usize>
Output positions of the stack-level class latents for an orig_len
input (so a caller can read a class latent back out of the lengthened
forward output — e.g. as a pooled summary).
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 bidirectional pass. The ssd_path must match the stack’s
family; a mismatch is a caller error and panics.
Trait Implementations§
Source§impl AutodiffModule for MambaBidiLayers
impl AutodiffModule for MambaBidiLayers
Source§impl Clone for MambaBidiLayers
impl Clone for MambaBidiLayers
Source§impl Debug for MambaBidiLayers
impl Debug for MambaBidiLayers
Source§impl Display for MambaBidiLayers
impl Display for MambaBidiLayers
Source§impl Module for MambaBidiLayers
impl Module for MambaBidiLayers
Source§type Record = MambaBidiLayersRecord
type Record = MambaBidiLayersRecord
Type to save and load the module.
Source§fn load_record(self, record: Self::Record) -> Self
fn load_record(self, record: Self::Record) -> Self
Load the module state from a record.
Source§fn into_record(self) -> Self::Record
fn into_record(self) -> Self::Record
Convert the module into a record containing the state.
Source§fn num_params(&self) -> usize
fn num_params(&self) -> usize
Get the number of parameters the module has, including all of its sub-modules.
Source§fn visit<Visitor: ModuleVisitor>(&self, visitor: &mut Visitor)
fn visit<Visitor: ModuleVisitor>(&self, visitor: &mut Visitor)
Visit each tensor parameter in the module with a visitor.
Source§fn map<Mapper: ModuleMapper>(self, mapper: &mut Mapper) -> Self
fn map<Mapper: ModuleMapper>(self, mapper: &mut Mapper) -> Self
Map each tensor parameter in the module with a mapper.
Source§fn collect_devices(&self, devices: Devices) -> Devices
fn collect_devices(&self, devices: Devices) -> Devices
Return all the devices found in the underneath module tree added to the given vector
without duplicates.
Source§fn to_device(self, device: &Device) -> Self
fn to_device(self, device: &Device) -> Self
Move the module and all of its sub-modules to the given device. Read more
Source§fn fork(self, device: &Device) -> Self
fn fork(self, device: &Device) -> Self
Fork the module and all of its sub-modules to the given device. Read more
§fn devices(&self) -> Vec<Device>
fn devices(&self) -> Vec<Device>
Return all the devices found in the underneath module tree without duplicates.
§fn train(self) -> Selfwhere
Self: AutodiffModule,
fn train(self) -> Selfwhere
Self: AutodiffModule,
Move the module and all of its sub-modules to the autodiff backend. Read more
§fn quantize_weights(self, quantizer: &mut Quantizer) -> Self
fn quantize_weights(self, quantizer: &mut Quantizer) -> Self
Quantize the weights of the module.
Source§impl ModuleDisplay for MambaBidiLayers
impl ModuleDisplay for MambaBidiLayers
§fn format(&self, passed_settings: DisplaySettings) -> String
fn format(&self, passed_settings: DisplaySettings) -> String
Formats the module with provided display settings. Read more
§fn custom_settings(&self) -> Option<DisplaySettings>
fn custom_settings(&self) -> Option<DisplaySettings>
Custom display settings for the module. Read more
§fn custom_content(&self, _content: Content) -> Option<Content>
fn custom_content(&self, _content: Content) -> Option<Content>
Custom attributes for the module. Read more
Auto Trait Implementations§
impl !Freeze for MambaBidiLayers
impl !RefUnwindSafe for MambaBidiLayers
impl !UnwindSafe for MambaBidiLayers
impl Send for MambaBidiLayers
impl Sync for MambaBidiLayers
impl Unpin for MambaBidiLayers
impl UnsafeUnpin for MambaBidiLayers
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