def METHOD_NAME(self):
    predictions = self._get_default_predictions_tensor(0.0)
    # half prediction are 0 class, the other half 1 class.
    predictions[:, 0, : self.img_size // 2] = 1.0
    predictions[:, 1, self.img_size // 2 :] = 1.0
    # only 0 class in target.
    target = self._get_default_target_zeroes_tensor()
    intersection = torch.tensor([0.5, 0.0])
    denominator = torch.tensor([1.5, 0.5])
    counts = torch.tensor([target.numel(), 0.0])
    weights = 1 / (counts**2)
    weights[1] = 0.0  # instead of inf
    eps = 1e-17
    expected_dice_loss = 1.0 - ((2.0 * weights * intersection) / (weights * denominator + eps))
    expected_dice_loss = expected_dice_loss.mean()
    criterion = GeneralizedDiceLoss(smooth=0, eps=eps, apply_softmax=False)
    dice_loss = criterion(predictions, target)
    self._assertion_dice_torch_values(expected_dice_loss, dice_loss)