pub struct BidiLayersBuilder<C> {
pub n_real_layers: usize,
pub n_virtual_layers: Option<(usize, BidiSchedule)>,
pub mamba_block: C,
pub ignore_first_residual: bool,
pub ignore_last_residual: bool,
pub outputs_merge: Vec<OutputMergeConfig>,
pub class_latents: Vec<ClassLatent>,
pub residuals: ResidualsConfig,
}Expand description
Plain (non-serde) factory for BidiLayers.
Fields§
§n_real_layers: usizeNumber of real (weight-bearing) layers (must be even).
n_virtual_layers: Option<(usize, BidiSchedule)>Optional virtual-layer scheduling.
mamba_block: CShared block config.
ignore_first_residual: boolZero the first virtual pair’s residual.
ignore_last_residual: boolZero the last virtual pair’s residual.
outputs_merge: Vec<OutputMergeConfig>One merge config per pair, length n_real_layers / 2.
class_latents: Vec<ClassLatent>Stack-level class latents (spliced once before the first pair).
residuals: ResidualsConfigInter-pair residual scheme (defaults to plain additive).
Implementations§
Source§impl<C: MambaBlockConfig> BidiLayersBuilder<C>
impl<C: MambaBlockConfig> BidiLayersBuilder<C>
Sourcepub fn init(&self, device: &Device) -> BidiLayers<C::Block>
pub fn init(&self, device: &Device) -> BidiLayers<C::Block>
Allocate and initialise the bidirectional stack on device.
Auto Trait Implementations§
impl<C> Freeze for BidiLayersBuilder<C>where
C: Freeze,
impl<C> RefUnwindSafe for BidiLayersBuilder<C>where
C: RefUnwindSafe,
impl<C> Send for BidiLayersBuilder<C>where
C: Send,
impl<C> Sync for BidiLayersBuilder<C>where
C: Sync,
impl<C> Unpin for BidiLayersBuilder<C>where
C: Unpin,
impl<C> UnsafeUnpin for BidiLayersBuilder<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for BidiLayersBuilder<C>where
C: UnwindSafe,
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