Module clip

Module clip 

Source

Structs§

GradAccumulator
Gradient accumulation helper.

Functions§

clip_grad_norm
Clip gradients by their global L2 norm.
clip_grad_value
Clamp each gradient element to [-max_value, max_value].
grad_norm
Compute the global L2 norm of all gradients without clipping.