Skip to main content

encoder_layer_forward

Function encoder_layer_forward 

Source
pub fn encoder_layer_forward(
    x: &mut [f32],
    layer: &EncoderLayer,
    cfg: &AttnConfig,
    rope: &RopeCache,
    seq_len: usize,
    mask: Option<&[f32]>,
    tmp: &mut Vec<f32>,
    normed: &mut Vec<f32>,
)
Expand description

Run a single encoder layer on the full sequence. x: [seq_len, d_model] — modified in-place normed: scratch buffer [seq_len, d_model] — pre-allocated by caller, reused across layers