class_docstr: Clips gradients before doing optimization step.
  
  Args:
      optimizer (KeyedOptimizer): optimizer to wrap
      clipping (GradientClipping): how to clip gradients
      max_gradient (float): max value for clipping
code: def step(self, closure: Any = None) -> None:
      if self._check_meta:
          if any(t.device.type == "meta" for t in self._params):
              # skip gradient clipping and early return
              super().step(closure)
              return
          self._check_meta = False
  
      if self._clipping == GradientClipping.NORM:
          torch.nn.utils.clip_grad_norm_(
              self._params, self._max_gradient
          )
      elif self._clipping == GradientClipping.VALUE:
          torch.nn.utils.clip_grad_value_(
              self._params, self._max_gradient
          )
  
      super().step(closure)
  
file_path: torchrec/torchrec/optim/clipping.py
imports: from enum import Enum, unique
  from typing import Any, List
  import torch
  from torchrec.optim.keyed import KeyedOptimizer, OptimizerWrapper
label_desc: Use image node_id 2 for calling the GradientClippingOptimizer obj's underlying member method code with example usage: obj.step(closure) without return types