oa::ml::matrix::softmax_scaled_masked

Compute softmax(scores * scale + mask) over the final axis. The additive mask is detached from reverse mode. Errors Returns an error unless both values are equal-shape, nonempty, same-engine F32 matrices, or runtime recording fails.

FnRust public API

Function Documentation

pub fn softmax_scaled_masked( scores: &Matrix, mask: &Matrix, scale: f32 ) -> Result<Matrix>
Compute softmax(scores * scale + mask) over the final axis. The additive mask is detached from reverse mode. Errors Returns an error unless both values are equal-shape, nonempty, same-engine F32 matrices, or runtime recording fails.