class_docstr: Helper handler to log optimizer parameters
  
  Args:
      optimizer: torch optimizer or any object with attribute ``param_groups``
          as a sequence.
      param_name: parameter name
      tag: common title for all produced plots. For example, "generator"
  
  Examples:
      .. code-block:: python
  
          from ignite.contrib.handlers.polyaxon_logger import *
  
          # Create a logger
          plx_logger = PolyaxonLogger()
  
          # Attach the logger to the trainer to log optimizer's parameters, e.g. learning rate at each iteration
          plx_logger.attach(
              trainer,
              log_handler=OptimizerParamsHandler(optimizer),
              event_name=Events.ITERATION_STARTED
          )
          # or equivalently
          plx_logger.attach_opt_params_handler(
              trainer,
              event_name=Events.ITERATION_STARTED,
              optimizer=optimizer
          )
class_docstr_tok: ["Helper","handler","to","log","optimizer","parameters","Args",":","optimizer",":","torch","optimizer","or","any","object","with","attribute","``","param_groups","``","as","a","sequence",".","param_name",":","parameter","name","tag",":","common","title","for","all","produced","plots",".","For","example",",","``","generator","''","Examples",":","..","code-block",":",":","python","from","ignite.contrib.handlers.polyaxon_logger","import","*","#","Create","a","logger","plx_logger","=","PolyaxonLogger","(",")","#","Attach","the","logger","to","the","trainer","to","log","optimizer","'s","parameters",",","e.g",".","learning","rate","at","each","iteration","plx_logger.attach","(","trainer",",","log_handler=OptimizerParamsHandler","(","optimizer",")",",","event_name=Events.ITERATION_STARTED",")","#","or","equivalently","plx_logger.attach_opt_params_handler","(","trainer",",","event_name=Events.ITERATION_STARTED",",","optimizer=optimizer",")"]
code: def __call__(
      self,
      engine: Engine,
      logger: PolyaxonLogger,
      event_name: Union[str, Events],
  ) -> None:
      if not isinstance(logger, PolyaxonLogger):
          raise RuntimeError(
              "Handler OptimizerParamsHandler works only with PolyaxonLogger"
          )
  
      global_step = engine.state.get_event_attrib_value(event_name)
      tag_prefix = f"{self.tag}/" if self.tag else ""
      params = {
          f"{tag_prefix}{self.param_name}/group_{i}": float(
              param_group[self.param_name]
          )
          for i, param_group in enumerate(self.optimizer.param_groups)
      }
      params["step"] = global_step
      logger.log_metrics(**params)
  
file_path: ignite/ignite/contrib/handlers/polyaxon_logger.py
imports: from typing import Any, Callable, List, Optional, Union
  from torch.optim import Optimizer
  from ignite.contrib.handlers.base_logger import BaseLogger, BaseOptimizerParamsHandler, BaseOutputHandler
  from ignite.engine import Engine, Events
  from ignite.handlers import global_step_from_engine
label_desc: Use image node_id 2 for calling the OptimizerParamsHandler obj's underlying member method code with example usage: obj.__call__(engine, logger, event_name) without return types