Clips gradient of an iterable of parameters to a specified lower and
upper. Gradients are modified in-place.
The gradients are clipped in the range:
\[\left[\text{lower}, \text{upper}\right]\]
- Parameters:
tensors (Union
[Tensor
, Iterable
[Tensor
]]) – an iterable of Tensors or a single Tensor.
lower (float
) – minimum allowed value of the gradients.
upper (float
) – maximum allowed value of the gradients.