grad_norm

Function grad_norm 

Source
pub fn grad_norm<B>(
    grads: &GradStore<B>,
    params: &[Tensor<B>],
) -> Result<f64, Error>
where B: Backend,
Expand description

Compute the global L2 norm of all gradients without clipping.

Useful for monitoring gradient magnitudes during training.