class_docstr: BBoxL1Cost.
  
  Note: ``bboxes`` in ``InstanceData`` passed in is of format 'xyxy'
  and its coordinates are unnormalized.
  
  Args:
      box_format (str, optional): 'xyxy' for DETR, 'xywh' for Sparse_RCNN.
          Defaults to 'xyxy'.
      weight (Union[float, int]): Cost weight. Defaults to 1.
  
  Examples:
      >>> from mmdet.models.task_modules.assigners.
      ... match_costs.match_cost import BBoxL1Cost
      >>> import torch
      >>> self = BBoxL1Cost()
      >>> bbox_pred = torch.rand(1, 4)
      >>> gt_bboxes= torch.FloatTensor([[0, 0, 2, 4], [1, 2, 3, 4]])
      >>> factor = torch.tensor([10, 8, 10, 8])
      >>> self(bbox_pred, gt_bboxes, factor)
      tensor([[1.6172, 1.6422]])
class_docstr_tok: ["BBoxL1Cost",".","Note",":","``","bboxes","``","in","``","InstanceData","``","passed","in","is","of","format","'xyxy'","and","its","coordinates","are","unnormalized",".","Args",":","box_format","(","str",",","optional",")",":","'xyxy","'","for","DETR",",","'xywh","'","for","Sparse_RCNN",".","Defaults","to","'xyxy","'",".","weight","(","Union","[","float",",","int","]",")",":","Cost","weight",".","Defaults","to","1",".","Examples",":",">",">",">","from","mmdet.models.task_modules.assigners",".","...","match_costs.match_cost","import","BBoxL1Cost",">",">",">","import","torch",">",">",">","self","=","BBoxL1Cost","(",")",">",">",">","bbox_pred","=","torch.rand","(","1",",","4",")",">",">",">","gt_bboxes=","torch.FloatTensor","(","[","[","0",",","0",",","2",",","4","]",",","[","1",",","2",",","3",",","4","]","]",")",">",">",">","factor","=","torch.tensor","(","[","10",",","8",",","10",",","8","]",")",">",">",">","self","(","bbox_pred",",","gt_bboxes",",","factor",")","tensor","(","[","[","1.6172",",","1.6422","]","]",")"]
code: def __init__(
      self, box_format: str = "xyxy", weight: Union[float, int] = 1.0
  ) -> None:
      super().__init__(weight=weight)
      assert box_format in ["xyxy", "xywh"]
      self.box_format = box_format
  
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 BBoxL1Cost object from inherited base classes: BaseMatchCost with example: obj = BBoxL1Cost(box_format, weight)