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
docstr: :param params: a list of parameters
  :type params: an iterable of strings
  
  Do an optimization step for each param in params. If a given param has never been seen before,
  initialize an optimizer for it.
docstr_tok: [":","param","params",":","a","list","of","parameters",":","type","params",":","an","iterable","of","strings","Do","an","optimization","step","for","each","param","in","params",".","If","a","given","param","has","never","been","seen","before",",","initialize","an","optimizer","for","it","."]
code: def __call__(
      self, params: Union[List, ValuesView], *args, **kwargs
  ) -> None:
      """
      :param params: a list of parameters
      :type params: an iterable of strings
  
      Do an optimization step for each param in params. If a given param has never been seen before,
      initialize an optimizer for it.
      """
      for p in params:
          # if we have not seen this param before, we instantiate an optim object to deal with it
          if p not in self.optim_objs:
              # create a single optim object for that param
              optimizer = self.optim_objs[p] = self._get_optim(p)
              # create a gradient clipping function if specified
              self.grad_clip[p] = self._get_grad_clip(p)
              # set state from _state_waiting_to_be_consumed if present
              param_name = pyro.get_param_store().param_name(p)
              state = self._state_waiting_to_be_consumed.pop(
                  param_name, None
              )
              if state is not None:
                  _load_state_dict(optimizer, state)
  
          if self.grad_clip[p] is not None:
              self.grad_clip[p](p)
  
          if (
              hasattr(torch.optim.lr_scheduler, "_LRScheduler")
              and isinstance(
                  self.optim_objs[p],
                  torch.optim.lr_scheduler._LRScheduler,
              )
              or hasattr(torch.optim.lr_scheduler, "LRScheduler")
              and isinstance(
                  self.optim_objs[p],
                  torch.optim.lr_scheduler.LRScheduler,
              )
              or isinstance(
                  self.optim_objs[p],
                  torch.optim.lr_scheduler.ReduceLROnPlateau,
              )
          ):
              # if optim object was a scheduler, perform an optimizer step
              self.optim_objs[p].optimizer.step(*args, **kwargs)
          else:
              self.optim_objs[p].step(*args, **kwargs)
  
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 2 for calling the PyroOptim obj's underlying member method code with example usage: obj.__call__(params) without return types