docstr: Args:
      cls_pred (Tensor): Predicted classification logits, shape
          (num_queries, num_class).
      gt_labels (Tensor): Label of `gt_bboxes`, shape (num_gt,).
  
  Returns:
      torch.Tensor: cls_cost value with weight
code: def _focal_loss_cost(
      self, cls_pred: Tensor, gt_labels: Tensor
  ) -> Tensor:
      """
      Args:
          cls_pred (Tensor): Predicted classification logits, shape
              (num_queries, num_class).
          gt_labels (Tensor): Label of `gt_bboxes`, shape (num_gt,).
  
      Returns:
          torch.Tensor: cls_cost value with weight
      """
      cls_pred = cls_pred.flatten(1)
      gt_labels = gt_labels.flatten(1).float()
      cls_pred = cls_pred.sigmoid()
      neg_cost = (
          -(1 - cls_pred + self.eps).log()
          * (1 - self.alpha)
          * cls_pred.pow(self.gamma)
      )
      pos_cost = (
          -(cls_pred + self.eps).log()
          * self.alpha
          * (1 - cls_pred).pow(self.gamma)
      )
  
      cls_cost = torch.einsum(
          "nc,mc->nm", pos_cost, gt_labels
      ) + torch.einsum("nc,mc->nm", neg_cost, (1 - gt_labels))
      return cls_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 1 for calling the BinaryFocalLossCost obj's underlying member method code with example usage: obj._focal_loss_cost(cls_pred, gt_labels) and returns: unknown