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"
      sync: If set to False, process calls to log in a seperate thread. Default (None) uses whatever
          the default value of wandb.log.
  
  Examples:
      .. code-block:: python
  
          from ignite.contrib.handlers.wandb_logger import *
  
          # Create a logger. All parameters are optional. See documentation
          # on wandb.init for details.
  
          wandb_logger = WandBLogger(
              entity="shared",
              project="pytorch-ignite-integration",
              name="cnn-mnist",
              config={"max_epochs": 10},
              tags=["pytorch-ignite", "minst"]
          )
  
          # Attach the logger to the trainer to log optimizer's parameters, e.g. learning rate at each iteration
          wandb_logger.attach(
              trainer,
              log_handler=OptimizerParamsHandler(optimizer),
              event_name=Events.ITERATION_STARTED
          )
          # or equivalently
          wandb_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","''","sync",":","If","set","to","False",",","process","calls","to","log","in","a","seperate","thread",".","Default","(","None",")","uses","whatever","the","default","value","of","wandb.log",".","Examples",":","..","code-block",":",":","python","from","ignite.contrib.handlers.wandb_logger","import","*","#","Create","a","logger",".","All","parameters","are","optional",".","See","documentation","#","on","wandb.init","for","details",".","wandb_logger","=","WandBLogger","(","entity=","''","shared","''",",","project=","''","pytorch-ignite-integration","''",",","name=","''","cnn-mnist","''",",","config=","{","``","max_epochs","''",":","10","}",",","tags=","[","``","pytorch-ignite","''",",","``","minst","''","]",")","#","Attach","the","logger","to","the","trainer","to","log","optimizer","'s","parameters",",","e.g",".","learning","rate","at","each","iteration","wandb_logger.attach","(","trainer",",","log_handler=OptimizerParamsHandler","(","optimizer",")",",","event_name=Events.ITERATION_STARTED",")","#","or","equivalently","wandb_logger.attach_opt_params_handler","(","trainer",",","event_name=Events.ITERATION_STARTED",",","optimizer=optimizer",")"]
code: def __init__(
      self,
      optimizer: Optimizer,
      param_name: str = "lr",
      tag: Optional[str] = None,
      sync: Optional[bool] = None,
  ):
      super(OptimizerParamsHandler, self).__init__(
          optimizer, param_name, tag
      )
      self.sync = sync
  
file_path: ignite/ignite/contrib/handlers/wandb_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 1 to create a new OptimizerParamsHandler object from inherited base classes: BaseOptimizerParamsHandler with example: obj = OptimizerParamsHandler(optimizer, param_name, tag, sync)