docstr: Copied from torch.optim.optimizer
docstr_tok: ["Copied","from","torch.optim.optimizer"]
code: def zero_grad(self, set_to_none=True):
      """Copied from torch.optim.optimizer"""
      for group in self.optimizer.param_groups:
          _zero_grad_group_helper(group["params"], set_to_none)
  
imports: from abc import ABC
  from abc import abstractmethod
  from apex.multi_tensor_apply import multi_tensor_applier
  import amp_C
  import torch
  from megatron import get_timers
  from megatron import print_rank_0
  from megatron.core import mpu, tensor_parallel
  from megatron.model import Float16Module
  from megatron.model.module import param_is_not_shared
  from .clip_grads import clip_grad_norm_fp32, count_zeros_fp32
label_desc: Use image node_id 2 for calling the FP32Optimizer obj's underlying member method code with example usage: obj.zero_grad(set_to_none) without return types