Skip to main content

Module bidi

Module bidi 

Source
Expand description

Bidirectional layer stacks (straight + reversed passes, merged per pair).

Structs§

BidiLayerPair
A single bidirectional pair: a straight (→) and a reversed (←) Pre-LN block whose outputs are merged. The residual is not applied here — the enclosing BidiLayers adds it (or suppresses it on the first/last pair), mirroring the Layer / Layers split.
BidiLayerPairRecord
The record type for the module.
BidiLayerPairRecordItem
The record item type for the module.
BidiLayers
A stack of bidirectional Layer pairs with optional virtual-layer scheduling — one struct for every Mamba-x family.
BidiLayersBuilder
Plain (non-serde) factory for BidiLayers.
BidiLayersRecord
The record type for the module.
BidiLayersRecordItem
The record item type for the module.
NoOp
A zero-parameter placeholder for the parameterless Mean merge.

Enums§

MambaBidiLayers
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.
MambaBidiLayersConfig
The serializable config for MambaBidiLayers. Each variant is concrete (per-family), so #[derive(Config)] applies; init builds the matching stack variant.
MambaBidiLayersConfigSerde 🔒
MambaBidiLayersRecord
The record type for the module.
MambaBidiLayersRecordItem
The record item type for the module.
OutputMerge
How the two directions of a bidirectional pair are combined.
OutputMergeConfig
Configuration / factory for OutputMerge.
OutputMergeConfigSerde 🔒
OutputMergeRecord
The record type for the module.
OutputMergeRecordItem
The record item type for the module.

Functions§

bidi_pair_forward 🔒
The straight + reverse + merge computation of a bidirectional pair, over borrowed sub-modules.