torch.nn.utils.clip_grad_value_
- torch.nn.utils.clip_grad_value_(parameters, clip_value, foreach=None)
Clip the gradients of an iterable of parameters at specified value.
Gradients are modified in-place.
- Parameters:
parameters (Iterable) – an iterable of Tensors or a single Tensor that will have gradients normalized