API 相关说明
Clips gradient norm of an iterable of parameters. The norm is computed over all gradients together, as if they were concatenated into a single vector. Gradients are modified in-place.
tensors (Union[Tensor, Iterable[Tensor]]) – an iterable of Tensors or a single Tensor.
Union
Tensor
Iterable
max_norm (float) – max norm of the gradients.
float
ord (float) – type of the used p-norm. Can be 'inf' for infinity norm.
'inf'
total norm of the parameters (viewed as a single vector).
上一页
megengine.optimizer.MultiStepLR.step
下一页
megengine.optimizer.clip_grad_value