class_docstr: A wrapper of torch.Optimizer that clips gradients by global norm before each step
class_docstr_tok: ["A","wrapper","of","torch.Optimizer","that","clips","gradients","by","global","norm","before","each","step"]
code: def step(self, *args, **kwargs):
      parameters = tuple(
          param
          for group in self.param_groups
          for param in group["params"]
      )
      torch.nn.utils.clip_grad_norm_(parameters, self.clip_grad_norm)
      return super().step(*args, **kwargs)
  
file_path: hivemind/hivemind/moe/server/layers/optim.py
imports: import torch
label_desc: Use image node_id 2 for calling the ClippingWrapper obj's underlying member method code with example usage: obj.step() and returns: super