class_docstr: FocalLossCost.
  
  Args:
      alpha (Union[float, int]): focal_loss alpha. Defaults to 0.25.
      gamma (Union[float, int]): focal_loss gamma. Defaults to 2.
      eps (float): Defaults to 1e-12.
      binary_input (bool): Whether the input is binary. Currently,
          binary_input = True is for masks input, binary_input = False
          is for label input. Defaults to False.
      weight (Union[float, int]): Cost weight. Defaults to 1.
class_docstr_tok: ["FocalLossCost",".","Args",":","alpha","(","Union","[","float",",","int","]",")",":","focal_loss","alpha",".","Defaults","to","0.25.","gamma","(","Union","[","float",",","int","]",")",":","focal_loss","gamma",".","Defaults","to","2.","eps","(","float",")",":","Defaults","to","1e-12",".","binary_input","(","bool",")",":","Whether","the","input","is","binary",".","Currently",",","binary_input","=","True","is","for","masks","input",",","binary_input","=","False","is","for","label","input",".","Defaults","to","False",".","weight","(","Union","[","float",",","int","]",")",":","Cost","weight",".","Defaults","to","1","."]
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.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 = pos_cost[:, gt_labels] - neg_cost[:, 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 2 for calling the FocalLossCost obj's underlying member method code with example usage: obj._focal_loss_cost(cls_pred, gt_labels) and returns: unknown