Skip to main content

softmax_bwd

Function softmax_bwd 

Source
pub fn softmax_bwd(y: &Tensor, dy: &Tensor) -> Result<Tensor>
Expand description

Softmax backward from the forward output y: dx = y * (dy - sum(y*dy)) per row. Causal masking needs no parameters here — masked forward outputs are exact zeros.