oa::ml::matrix::rms_norm_gated

Apply per-row RMS normalization, a cyclic broadcast affine, and a SiLU gate. Normalization is over the final input dimension. The affine value may have one or more leading groups; those groups repeat over the flattened input rows. An optional bias must exactly match weight. Errors Returns an error for incompatible shape, dtype, Engine ownership or epsilon, or when runtime recording fails.

FnRust public API

Function Documentation

pub fn rms_norm_gated( input: &Matrix, weight: &Matrix, bias: Option<&Matrix>, gate: &Matrix, epsilon: f32 ) -> Result<Matrix>
Apply per-row RMS normalization, a cyclic broadcast affine, and a SiLU gate. Normalization is over the final input dimension. The affine value may have one or more leading groups; those groups repeat over the flattened input rows. An optional bias must exactly match weight. Errors Returns an error for incompatible shape, dtype, Engine ownership or epsilon, or when runtime recording fails.