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","]","]",")"]
code: def __init__(
      self, iou_mode: str = "giou", weight: Union[float, int] = 1.0
  ):
      super().__init__(weight=weight)
      self.iou_mode = iou_mode
  
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 1 to create a new IoUCost object from inherited base classes: BaseMatchCost with example: obj = IoUCost(iou_mode, weight)