code: def check_optimizer_lr_wd(optimizer, gt_lr_wd):
      assert isinstance(optimizer, torch.optim.AdamW)
      assert optimizer.defaults["lr"] == base_lr
      assert optimizer.defaults["weight_decay"] == base_wd
      param_groups = optimizer.param_groups
      print(param_groups)
      assert len(param_groups) == len(gt_lr_wd)
      for i, param_dict in enumerate(param_groups):
          assert (
              param_dict["weight_decay"] == gt_lr_wd[i]["weight_decay"]
          )
          assert param_dict["lr_scale"] == gt_lr_wd[i]["lr_scale"]
          assert param_dict["lr_scale"] == param_dict["lr"]
  
file_path: mmdetection/tests/test_engine/test_optimizers/test_layer_decay_optimizer_constructor.py
imports: import torch
  import torch.nn
  from mmcv.cnn import ConvModule
  from mmdet.engine import LearningRateDecayOptimizerConstructor
label_desc: Use image node_id 1 for calling a global function with example usage: check_optimizer_lr_wd(optimizer, gt_lr_wd) without return types