code: def patch_param_groups(
      model: nn.Module,
      head_layers: List[nn.Module],
      backbone_param_groups: List[List[nn.Parameter]],
  ):
      def param_groups(model: nn.Module) -> List[List[nn.Parameter]]:
          head_param_groups = [
              list(layer.parameters()) for layer in head_layers
          ]
  
          _param_groups = backbone_param_groups + head_param_groups
          check_all_model_params_in_groups2(model, _param_groups)
  
          return _param_groups
  
      model.param_groups = MethodType(param_groups, model)
  
file_path: icevision/icevision/models/torchvision/utils.py
imports: from icevision.imports import *
  from icevision.utils import *
  from torchvision.models.detection.generalized_rcnn import GeneralizedRCNN
label_desc: Use image node_id 4 for calling a global function with example usage: patch_param_groups(model, head_layers, backbone_param_groups) and returns: _param_groups