docstr: Clears the gradients of all optimized parameters.
code: def zero_grad(self):
      """
      Clears the gradients of all optimized parameters.
      """
      for p in self.fp16_params:
          p.grad = None
      for p32 in self.fp32_params:
          p32.grad.zero_()
      self._needs_sync = False
  
imports: import math
  from itertools import chain
  from typing import Optional
  import parlai.utils.logging
label_desc: Use image node_id 12 for calling the SafeFP16Optimizer obj's underlying member method code with example usage: obj.zero_grad() without return types