class_docstr: From DETR source: https://github.com/facebookresearch/detr
  (detr/models/detr.py)
class_docstr_tok: ["From","DETR","source",":","https",":","\/\/github.com\/facebookresearch\/detr","(","detr\/models\/detr.py",")"]
docstr: From DETR source: https://github.com/facebookresearch/detr
  (detr/models/segmentation.py)
docstr_tok: ["From","DETR","source",":","https",":","\/\/github.com\/facebookresearch\/detr","(","detr\/models\/segmentation.py",")"]
code: def dice_loss(inputs, targets, num_boxes):
      """
      From DETR source: https://github.com/facebookresearch/detr
      (detr/models/segmentation.py)
      """
      inputs = inputs.sigmoid()
      inputs = inputs.flatten(1)
      numerator = 2 * (inputs * targets).sum(1)
      denominator = inputs.sum(-1) + targets.sum(-1)
      loss = 1 - (numerator + 1) / (denominator + 1)
      return loss.sum() / num_boxes
  
imports: from typing import List, Optional, Tuple, Union
  import torch
label_desc: Use image node_id 2 for calling the SetCriterion obj's underlying member method code with example usage: obj.dice_loss(inputs, targets, num_boxes) and returns: unknown