class_docstr: IoUCost.
  
  Note: ``bboxes`` in ``InstanceData`` passed in is of format 'xyxy'
  and its coordinates are unnormalized.
  
  Args:
      iou_mode (str): iou mode such as 'iou', 'giou'. Defaults to 'giou'.
      weight (Union[float, int]): Cost weight. Defaults to 1.
  
  Examples:
      >>> from mmdet.models.task_modules.assigners.
      ... match_costs.match_cost import IoUCost
      >>> import torch
      >>> self = IoUCost()
      >>> bboxes = torch.FloatTensor([[1,1, 2, 2], [2, 2, 3, 4]])
      >>> gt_bboxes = torch.FloatTensor([[0, 0, 2, 4], [1, 2, 3, 4]])
      >>> self(bboxes, gt_bboxes)
      tensor([[-0.1250,  0.1667],
          [ 0.1667, -0.5000]])
class_docstr_tok: ["IoUCost",".","Note",":","``","bboxes","``","in","``","InstanceData","``","passed","in","is","of","format","'xyxy'","and","its","coordinates","are","unnormalized",".","Args",":","iou_mode","(","str",")",":","iou","mode","such","as","'iou","'",",","'giou","'",".","Defaults","to","'giou","'",".","weight","(","Union","[","float",",","int","]",")",":","Cost","weight",".","Defaults","to","1",".","Examples",":",">",">",">","from","mmdet.models.task_modules.assigners",".","...","match_costs.match_cost","import","IoUCost",">",">",">","import","torch",">",">",">","self","=","IoUCost","(",")",">",">",">","bboxes","=","torch.FloatTensor","(","[","[","1,1",",","2",",","2","]",",","[","2",",","2",",","3",",","4","]","]",")",">",">",">","gt_bboxes","=","torch.FloatTensor","(","[","[","0",",","0",",","2",",","4","]",",","[","1",",","2",",","3",",","4","]","]",")",">",">",">","self","(","bboxes",",","gt_bboxes",")","tensor","(","[","[","-0.1250",",","0.1667","]",",","[","0.1667",",","-0.5000","]","]",")"]
docstr: Compute match cost.
  
  Args:
      pred_instances (:obj:`InstanceData`): ``bboxes`` inside is
          predicted boxes with unnormalized coordinate
          (x, y, x, y).
      gt_instances (:obj:`InstanceData`): ``bboxes`` inside is gt
          bboxes with unnormalized coordinate (x, y, x, y).
      img_meta (Optional[dict]): Image information. Defaults to None.
  
  Returns:
      Tensor: Match Cost matrix of shape (num_preds, num_gts).
code: def __call__(
      self,
      pred_instances: InstanceData,
      gt_instances: InstanceData,
      img_meta: Optional[dict] = None,
      **kwargs,
  ):
      """Compute match cost.
  
      Args:
          pred_instances (:obj:`InstanceData`): ``bboxes`` inside is
              predicted boxes with unnormalized coordinate
              (x, y, x, y).
          gt_instances (:obj:`InstanceData`): ``bboxes`` inside is gt
              bboxes with unnormalized coordinate (x, y, x, y).
          img_meta (Optional[dict]): Image information. Defaults to None.
  
      Returns:
          Tensor: Match Cost matrix of shape (num_preds, num_gts).
      """
      pred_bboxes = pred_instances.bboxes
      gt_bboxes = gt_instances.bboxes
  
      # avoid fp16 overflow
      if pred_bboxes.dtype == torch.float16:
          fp16 = True
          pred_bboxes = pred_bboxes.to(torch.float32)
      else:
          fp16 = False
  
      overlaps = bbox_overlaps(
          pred_bboxes, gt_bboxes, mode=self.iou_mode, is_aligned=False
      )
  
      if fp16:
          overlaps = overlaps.to(torch.float16)
  
      # The 1 is a constant that doesn't change the matching, so omitted.
      iou_cost = -overlaps
      return iou_cost * self.weight
  
imports: from abc import abstractmethod
  from typing import Optional, Union
  import torch
  import torch.nn.functional
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import TASK_UTILS
  from mmdet.structures.bbox import bbox_overlaps, bbox_xyxy_to_cxcywh
label_desc: Use image node_id 2 for calling the IoUCost obj's underlying member method code with example usage: obj.__call__(pred_instances, gt_instances, img_meta) and returns: unknown