class_docstr: A masked version of the Dice loss.
  
  :param ignore_value: the value to ignore.
code: def forward(self, input, target):
      eps = 0.0001
  
      masking = target == self.ignore_value
      masking = masking.sum(3).sum(2)
      masking = masking == 0
      masking = masking.squeeze()
  
      labeled_target = target.index_select(
          0, masking.nonzero().squeeze()
      )
      labeled_input = input.index_select(0, masking.nonzero().squeeze())
  
      iflat = labeled_input.view(-1)
      tflat = labeled_target.view(-1)
  
      intersection = (iflat * tflat).sum()
      union = iflat.sum() + tflat.sum()
  
      dice = (2.0 * intersection + eps) / (union + eps)
  
      return -dice
  
file_path: medicaltorch/medicaltorch/losses.py
imports: import torch
  from torch.nn import Module
label_desc: Use image node_id 2 for calling the MaskedDiceLoss obj's underlying member method code with example usage: obj.forward(input, target) and returns: unknown