code: def __init__(
      self,
      model: Module,
      optimizer_class: Type[Optimizer],
      *args,
      **kwargs,
  ):
      assert isinstance(model, Module), "Only support pytorch module."
      assert issubclass(
          optimizer_class, Optimizer
      ), "Only support pytorch optimizer"
  
      args = list(args)
      if "params" in kwargs:
          kwargs["params"] = self.params2names(model, kwargs["params"])
      else:
          args[0] = self.params2names(model, args[0])
      super().__init__(optimizer_class, *args, **kwargs)
  
imports: from __future__ import annotations
  from copy import deepcopy
  from typing import Callable, Dict, List, Type
  from torch import Tensor
  from torch.nn import Module
  from torch.optim import Optimizer
  from nni.common.serializer import is_traceable
  from nni.common.types import SCHEDULER
label_desc: Use image node_id 1 to create a new OptimizerConstructHelper object from inherited base classes: ConstructHelper with example: obj = OptimizerConstructHelper(model, optimizer_class)