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 __init__(
      self, optim: torch.optim.Optimizer, clip_grad_norm: float
  ):
      super().__init__(optim)
      self.clip_grad_norm = clip_grad_norm
  
file_path: hivemind/hivemind/moe/server/layers/optim.py
imports: import torch
label_desc: Use image node_id 1 to create a new ClippingWrapper object from inherited base classes: OptimizerWrapper with example: obj = ClippingWrapper(optim, clip_grad_norm)