API 相关说明
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:
tensors (Union[Tensor, Iterable[Tensor]]) – an iterable of Tensors or a single Tensor.
Union
Tensor
Iterable
lower (float) – minimum allowed value of the gradients.
float
upper (float) – maximum allowed value of the gradients.
上一页
megengine.optimizer.clip_grad_norm
下一页
megengine.jit