code: def dice_score(inputs, targets):
      inputs = inputs.sigmoid()
      numerator = 2 * torch.matmul(inputs, targets.t())
      denominator = (inputs * inputs).sum(-1)[:, None] + (
          targets * targets
      ).sum(-1)
      score = numerator / (denominator + 1e-4)
      return score
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from scipy.optimize import linear_sum_assignment
  from torch.cuda.amp import autocast
  from mmdet.registry import MODELS, TASK_UTILS
  from mmdet.utils import reduce_mean
label_desc: Use image node_id 2 for calling a global function with example usage: dice_score(inputs, targets) and returns: score