pub fn clip_gradient<A, D>( gradient: &mut ArrayBase<OwnedRepr<A>, D>, threshold: A, )where A: Float + ScalarOperand, D: Dimension,
Clip the gradient to a maximum value.