class_docstr: Base handler for logging optimizer parameters
class_docstr_tok: ["Base","handler","for","logging","optimizer","parameters"]
code: def __init__(
      self,
      optimizer: Optimizer,
      param_name: str = "lr",
      tag: Optional[str] = None,
  ):
      if not (
          isinstance(optimizer, Optimizer)
          or (
              hasattr(optimizer, "param_groups")
              and isinstance(optimizer.param_groups, Sequence)
          )
      ):
          raise TypeError(
              "Argument optimizer should be torch.optim.Optimizer or has attribute 'param_groups' as list/tuple, "
              f"but given {type(optimizer)}"
          )
  
      self.optimizer = optimizer
      self.param_name = param_name
      self.tag = tag
  
imports: import numbers
  import warnings
  from abc import ABCMeta, abstractmethod
  from collections import OrderedDict
  from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
  import torch
  import torch.nn
  from torch.optim import Optimizer
  from ignite.engine import Engine, Events, EventsList, State
  from ignite.engine.events import CallableEventWithFilter, RemovableEventHandle
label_desc: Use image node_id 1 to create a new BaseOptimizerParamsHandler object from inherited base classes: BaseHandler with example: obj = BaseOptimizerParamsHandler(optimizer, param_name, tag)