Skip to main content

softmax_bwd

Function softmax_bwd 

Source
pub fn softmax_bwd(y: &[f32], dy: &[f32], rows: usize, cols: usize) -> Vec<f32>
Expand description

Softmax backward: dx = y * (dy - sum(y * dy)) per row. The causal-masked forward writes exact zeros at masked entries, so no mask is needed here.