def zero_grad(self):
        """Clears the gradients of all optimized parameters."""
        for p in self.fp16_params:
            p.grad = None
        self._needs_sync = False
Clears the gradients of all optimized parameters.
infoxlm/fairseq/fairseq/optim/fp16_optimizer.py