class_docstr: Cost of mask assignments based on dice losses.
  
  Args:
      pred_act (bool): Whether to apply sigmoid to mask_pred.
          Defaults to False.
      eps (float): Defaults to 1e-3.
      naive_dice (bool): If True, use the naive dice loss
          in which the power of the number in the denominator is
          the first power. If False, use the second power that
          is adopted by K-Net and SOLO. Defaults to True.
      weight (Union[float, int]): Cost weight. Defaults to 1.
class_docstr_tok: ["Cost","of","mask","assignments","based","on","dice","losses",".","Args",":","pred_act","(","bool",")",":","Whether","to","apply","sigmoid","to","mask_pred",".","Defaults","to","False",".","eps","(","float",")",":","Defaults","to","1e-3",".","naive_dice","(","bool",")",":","If","True",",","use","the","naive","dice","loss","in","which","the","power","of","the","number","in","the","denominator","is","the","first","power",".","If","False",",","use","the","second","power","that","is","adopted","by","K-Net","and","SOLO",".","Defaults","to","True",".","weight","(","Union","[","float",",","int","]",")",":","Cost","weight",".","Defaults","to","1","."]
code: def __init__(
      self,
      pred_act: bool = False,
      eps: float = 1e-3,
      naive_dice: bool = True,
      weight: Union[float, int] = 1.0,
  ) -> None:
      super().__init__(weight=weight)
      self.pred_act = pred_act
      self.eps = eps
      self.naive_dice = naive_dice
  
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 DiceCost object from inherited base classes: BaseMatchCost with example: obj = DiceCost(pred_act, eps, naive_dice, weight)