class_docstr: ClsSoftmaxCost.Borrow from
  mmdet.core.bbox.match_costs.match_cost.ClassificationCost.
  
   Args:
       weight (int | float, optional): loss_weight
  
   Examples:
       >>> 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]])
docstr: Args:
      cls_pred (Tensor): Predicted classification logits, shape
          [num_query, num_class].
      gt_labels (Tensor): Label of `gt_bboxes`, shape (num_gt,).
  
  Returns:
      torch.Tensor: cls_cost value with weight
docstr_tok: ["Args",":","cls_pred","(","Tensor",")",":","Predicted","classification","logits",",","shape","[","num_query",",","num_class","]",".","gt_labels","(","Tensor",")",":","Label","of","`","gt_bboxes","`",",","shape","(","num_gt",",",")",".","Returns",":","torch.Tensor",":","cls_cost","value","with","weight"]
code: def __call__(self, cls_pred, gt_labels):
      """
      Args:
          cls_pred (Tensor): Predicted classification logits, shape
              [num_query, num_class].
          gt_labels (Tensor): Label of `gt_bboxes`, shape (num_gt,).
  
      Returns:
          torch.Tensor: cls_cost value with weight
      """
      # Following the official DETR repo, contrary to the loss that
      # NLL is used, we approximate it in 1 - cls_score[gt_label].
      # The 1 is a constant that doesn't change the matching,
      # so it can be omitted.
      cls_score = cls_pred.softmax(-1)
      cls_cost = -cls_score[:, gt_labels]
      return cls_cost * self.weight
  
file_path: dinov2/dinov2/eval/segmentation_m2f/models/losses/match_costs.py
imports: import torch
  import torch.nn.functional
  from ..builder import MATCH_COST
label_desc: Use image node_id 2 for calling the ClassificationCost obj's underlying member method code with example usage: obj.__call__(cls_pred, gt_labels) and returns: unknown