parameters: (self)
docstring: Zero fp32 and fp16 parameter grads.
docstring_summary: Zero fp32 and fp16 parameter grads.
docstring_tokens: Zero fp32 and fp16 parameter grads .
function: def zero_grad(self):
          """
          Zero fp32 and fp16 parameter grads.
          """
          self.optimizer.zero_grad()
          for fp16_group in self.fp16_param_groups:
              for param in fp16_group:
                  if param.grad is not None:
                      param.grad.detach_()
                      param.grad.zero_()
function_tokens: def zero_grad ( self ) : self . optimizer . zero_grad ( ) for fp16_group in self . fp16_param_groups : for param in fp16_group : if param . grad is not None : param . grad . detach_ ( ) param . grad . zero_ ( )