code: def configure_optimizer(
      model, optim_class, optim_conf, weight_decay_conf
  ):
      # Set zero weight decay for some params
      add_optimizer_hooks(
          model,
          **weight_decay_conf,
      )
  
      # Normal parameters
      all_params = list(model.parameters())
      params = [p for p in all_params if not hasattr(p, "_optim")]
  
      # Instantiate base optimizer
      optimizer = optim_class(params, **optim_conf)
  
      # Add parameters with special hyperparameters
      hps = [
          getattr(p, "_optim")
          for p in all_params
          if hasattr(p, "_optim")
      ]
      hps = [
          dict(s)
          for s in sorted(
              list(dict.fromkeys(frozenset(hp.items()) for hp in hps))
          )
      ]  # Unique dicts
      for hp in hps:
          params = [
              p for p in all_params if getattr(p, "_optim", None) == hp
          ]
          optimizer.add_param_group(
              {"params": params, **optim_conf, **hp}
          )
  
      return optimizer
  
label_desc: Use image node_id 2 for calling a global function with example usage: configure_optimizer(model, optim_class, optim_conf, weight_decay_conf) and returns: optimizer