class_docstr: A wrapper for torch.optim.Optimizer objects that helps with managing dynamically generated parameters.
  
  :param optim_constructor: a torch.optim.Optimizer
  :param optim_args: a dictionary of learning arguments for the optimizer or a callable that returns
      such dictionaries
  :param clip_args: a dictionary of clip_norm and/or clip_value args or a callable that returns
      such dictionaries
code: def __init__(
      self,
      optim_constructor: Union[Callable, Optimizer, Type[Optimizer]],
      optim_args: Union[Dict, Callable[..., Dict]],
      clip_args: Optional[Union[Dict, Callable[..., Dict]]] = None,
  ):
      self.pt_optim_constructor = optim_constructor
  
      # must be callable or dict
      assert callable(optim_args) or isinstance(
          optim_args, dict
      ), "optim_args must be function that returns defaults or a defaults dictionary"
  
      if clip_args is None:
          clip_args = {}
  
      # must be callable or dict
      assert callable(clip_args) or isinstance(
          clip_args, dict
      ), "clip_args must be function that returns defaults or a defaults dictionary"
  
      # hold our args to be called/used
      self.pt_optim_args = optim_args
      if callable(optim_args):
          self.pt_optim_args_argc = len(
              inspect.signature(optim_args).parameters
          )
      self.pt_clip_args = clip_args
  
      # holds the torch optimizer objects
      self.optim_objs: Dict = {}
      self.grad_clip: Dict = {}
  
      # any optimizer state that's waiting to be consumed (because that parameter hasn't been seen before)
      self._state_waiting_to_be_consumed: Dict = {}
  
imports: import inspect
  from typing import Any, Callable, Dict, Iterable, List, Optional, Type, Union, ValuesView
  import torch
  from torch import Tensor
  from torch.nn.utils import clip_grad_norm_, clip_grad_value_
  from torch.optim import Optimizer
  import pyro
  from pyro.optim.adagrad_rmsprop import AdagradRMSProp
  from pyro.optim.clipped_adam import ClippedAdam
  from pyro.optim.dct_adam import DCTAdam
  from pyro.params.param_store import module_from_param_with_module_name, normalize_param_name, user_param_name
label_desc: Use image node_id 1 to create a new PyroOptim object  with example: obj = PyroOptim(optim_constructor, optim_args, clip_args)