class_docstr: ClsSoftmaxCost.
  
  Args:
      weight (Union[float, int]): Cost weight. Defaults to 1.
  
  Examples:
      >>> from mmdet.models.task_modules.assigners.
      ...  match_costs.match_cost import ClassificationCost
      >>> import torch
      >>> self = ClassificationCost()
      >>> cls_pred = torch.rand(4, 3)
      >>> gt_labels = torch.tensor([0, 1, 2])
      >>> factor = torch.tensor([10, 8, 10, 8])
      >>> self(cls_pred, gt_labels)
      tensor([[-0.3430, -0.3525, -0.3045],
          [-0.3077, -0.2931, -0.3992],
          [-0.3664, -0.3455, -0.2881],
          [-0.3343, -0.2701, -0.3956]])
class_docstr_tok: ["ClsSoftmaxCost",".","Args",":","weight","(","Union","[","float",",","int","]",")",":","Cost","weight",".","Defaults","to","1",".","Examples",":",">",">",">","from","mmdet.models.task_modules.assigners",".","...","match_costs.match_cost","import","ClassificationCost",">",">",">","import","torch",">",">",">","self","=","ClassificationCost","(",")",">",">",">","cls_pred","=","torch.rand","(","4",",","3",")",">",">",">","gt_labels","=","torch.tensor","(","[","0",",","1",",","2","]",")",">",">",">","factor","=","torch.tensor","(","[","10",",","8",",","10",",","8","]",")",">",">",">","self","(","cls_pred",",","gt_labels",")","tensor","(","[","[","-0.3430",",","-0.3525",",","-0.3045","]",",","[","-0.3077",",","-0.2931",",","-0.3992","]",",","[","-0.3664",",","-0.3455",",","-0.2881","]",",","[","-0.3343",",","-0.2701",",","-0.3956","]","]",")"]
code: def __init__(self, weight: Union[float, int] = 1) -> None:
      super().__init__(weight=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 1 to create a new ClassificationCost object from inherited base classes: BaseMatchCost with example: obj = ClassificationCost(weight)