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