class_docstr: Implements the cross entropy loss function.
  
  Args:
      weight (tuple|list|ndarray|Tensor, optional): A manual rescaling weight
          given to each class. Its length must be equal to the number of classes.
          Default ``None``.
      ignore_index (int64, optional): Specifies a target value that is ignored
          and does not contribute to the input gradient. Default ``255``.
      data_format (str, optional): The tensor format to use, 'NCHW' or 'NHWC'. Default ``'NCHW'``.
code: def __init__(
      self, weight=None, ignore_index=255, data_format="NCDHW"
  ):
      super(CrossEntropyLoss, self).__init__()
      self.ignore_index = ignore_index
      self.EPS = 1e-8
      self.data_format = data_format
      if weight is not None:
          self.weight = paddle.to_tensor(weight, dtype="float32")
      else:
          self.weight = None
  
file_path: PaddleSeg/contrib/MedicalSeg/medicalseg/models/losses/cross_entropy_loss.py
imports: import paddle
  from paddle import nn
  import paddle.nn.functional
  from medicalseg.models.losses import class_weights
  from medicalseg.cvlibs import manager
label_desc: Use image node_id 1 to create a new CrossEntropyLoss object from inherited base classes: nn with example: obj = CrossEntropyLoss(weight, ignore_index, data_format)