code: def test_cls_match_cost(self):
      gt_instances = InstanceData()
      gt_instances.bboxes = torch.FloatTensor(
          [[0, 0, 5, 7], [3, 5, 7, 8]]
      )
      gt_instances.labels = torch.LongTensor([1, 20])
      pred_instances = InstanceData()
      pred_instances.scores = torch.rand((10, 81))
      pred_instances.bboxes = torch.rand((10, 4))
      img_meta = dict(img_shape=(10, 8))
  
      # test FocalLossCost
      assigner = HungarianAssigner(dict(type="FocalLossCost"))
      assign_result = assigner.assign(
          pred_instances, gt_instances, img_meta=img_meta
      )
      self.assertTrue(torch.all(assign_result.gt_inds > -1))
      self.assertEqual(
          (assign_result.gt_inds > 0).sum(), gt_instances.bboxes.size(0)
      )
      self.assertEqual(
          (assign_result.labels > -1).sum(), gt_instances.bboxes.size(0)
      )
  
      # test ClassificationCost
      assigner = HungarianAssigner(dict(type="ClassificationCost"))
      assign_result = assigner.assign(
          pred_instances, gt_instances, img_meta=img_meta
      )
      self.assertTrue(torch.all(assign_result.gt_inds > -1))
      self.assertEqual(
          (assign_result.gt_inds > 0).sum(), gt_instances.bboxes.size(0)
      )
      self.assertEqual(
          (assign_result.labels > -1).sum(), gt_instances.bboxes.size(0)
      )
  
file_path: mmdetection/tests/test_models/test_task_modules/test_assigners/test_hungarian_assigner.py
imports: from unittest import TestCase
  import torch
  from mmengine import ConfigDict
  from mmengine.structures import InstanceData
  from mmdet.models.task_modules.assigners import HungarianAssigner
label_desc: Use image node_id 4 for calling the TestHungarianAssigner obj's underlying member method code with example usage: obj.test_cls_match_cost() without return types