class_docstr: Compute both Dice loss and Cross Entropy Loss, and return the weighted sum of these two losses.
  The details of Dice loss is shown in ``monai.losses.DiceLoss``.
  The details of Cross Entropy Loss is shown in ``torch.nn.CrossEntropyLoss`` and ``torch.nn.BCEWithLogitsLoss()``.
  In this implementation, two deprecated parameters ``size_average`` and ``reduce``, and the parameter ``ignore_index`` are
  not supported.
class_docstr_tok: ["Compute","both","Dice","loss","and","Cross","Entropy","Loss",",","and","return","the","weighted","sum","of","these","two","losses",".","The","details","of","Dice","loss","is","shown","in","``","monai.losses.DiceLoss","``",".","The","details","of","Cross","Entropy","Loss","is","shown","in","``","torch.nn.CrossEntropyLoss","``","and","``","torch.nn.BCEWithLogitsLoss","(",")","``",".","In","this","implementation",",","two","deprecated","parameters","``","size_average","``","and","``","reduce","``",",","and","the","parameter","``","ignore_index","``","are","not","supported","."]
docstr: Compute CrossEntropy loss for the input logits and target.
  Will remove the channel dim according to PyTorch CrossEntropyLoss:
  https://pytorch.org/docs/stable/generated/torch.nn.CrossEntropyLoss.html?#torch.nn.CrossEntropyLoss.
docstr_tok: ["Compute","CrossEntropy","loss","for","the","input","logits","and","target",".","Will","remove","the","channel","dim","according","to","PyTorch","CrossEntropyLoss",":","https",":","\/\/pytorch.org\/docs\/stable\/generated\/torch.nn.CrossEntropyLoss.html","?","#","torch.nn.CrossEntropyLoss","."]
code: def ce(
      self, input: torch.Tensor, target: torch.Tensor
  ) -> torch.Tensor:
      """
      Compute CrossEntropy loss for the input logits and target.
      Will remove the channel dim according to PyTorch CrossEntropyLoss:
      https://pytorch.org/docs/stable/generated/torch.nn.CrossEntropyLoss.html?#torch.nn.CrossEntropyLoss.
  
      """
      n_pred_ch, n_target_ch = input.shape[1], target.shape[1]
      if n_pred_ch != n_target_ch and n_target_ch == 1:
          target = torch.squeeze(target, dim=1)
          target = target.long()
      elif self.old_pt_ver:
          warnings.warn(
              f"Multichannel targets are not supported in this older Pytorch version {torch.__version__}. "
              "Using argmax (as a workaround) to convert target to a single channel."
          )
          target = torch.argmax(target, dim=1)
      elif not torch.is_floating_point(target):
          target = target.to(dtype=input.dtype)
  
      return self.cross_entropy(input, target)
  
imports: from __future__ import annotations
  import warnings
  from collections.abc import Callable, Sequence
  from typing import Any
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn.modules.loss import _Loss
  from monai.losses.focal_loss import FocalLoss
  from monai.losses.spatial_mask import MaskedLoss
  from monai.networks import one_hot
  from monai.utils import DiceCEReduction, LossReduction, Weight, deprecated_arg, look_up_option, pytorch_after
label_desc: Use image node_id 2 for calling the DiceCELoss obj's underlying member method code with example usage: obj.ce(input, target) and returns: self