code: def test_ga_rpn_head_predict_by_feat(self):
      s = 256
      img_metas = [
          {
              "img_shape": (s, s),
              "pad_shape": (s, s),
              "scale_factor": (1, 1),
          }
      ]
      ga_rpn_head = GARPNHead(**ga_rpn_config)
  
      feats = (
          torch.rand(1, 4, s // stride[1], s // stride[0])
          for stride in ga_rpn_head.square_anchor_generator.strides
      )
      outs = ga_rpn_head(feats)
  
      cfg = ConfigDict(
          dict(
              nms_pre=2000,
              nms_post=1000,
              max_per_img=300,
              nms=dict(type="nms", iou_threshold=0.7),
              min_bbox_size=0,
          )
      )
      ga_rpn_head.predict_by_feat(
          *outs, batch_img_metas=img_metas, cfg=cfg, rescale=True
      )
  
file_path: mmdetection/tests/test_models/test_dense_heads/test_ga_rpn_head.py
imports: from unittest import TestCase
  import torch
  from mmengine.config import ConfigDict
  from mmengine.structures import InstanceData
  from mmdet.models.dense_heads import GARPNHead
label_desc: Use image node_id 2 for calling the TestGARPNHead obj's underlying member method code with example usage: obj.test_ga_rpn_head_predict_by_feat() without return types