class_docstr: CrossEntropyLoss
class_docstr_tok: ["CrossEntropyLoss"]
docstr: Args:
      logits_ndim (int): number of dimensions (or rank) of the logits tensor
      weight (list): list of rescaling weight given to each class
      reduction (str): type of the reduction over the batch
docstr_tok: ["Args",":","logits_ndim","(","int",")",":","number","of","dimensions","(","or","rank",")","of","the","logits","tensor","weight","(","list",")",":","list","of","rescaling","weight","given","to","each","class","reduction","(","str",")",":","type","of","the","reduction","over","the","batch"]
code: def __init__(
      self,
      logits_ndim=2,
      weight=None,
      reduction="mean",
      ignore_index=-100,
  ):
      """
      Args:
          logits_ndim (int): number of dimensions (or rank) of the logits tensor
          weight (list): list of rescaling weight given to each class
          reduction (str): type of the reduction over the batch
      """
      if weight is not None and not torch.is_tensor(weight):
          weight = torch.FloatTensor(weight)
          logging.info(
              f"Weighted Cross Entropy loss with weight {weight}"
          )
      super().__init__(
          weight=weight, reduction=reduction, ignore_index=ignore_index
      )
      self._logits_dim = logits_ndim
  
imports: import torch
  from torch import nn
  from nemo.core.classes import Serialization, Typing, typecheck
  from nemo.core.neural_types import LabelsType, LogitsType, LogprobsType, LossType, MaskType, NeuralType
  from nemo.utils import logging
label_desc: Use image node_id 3 to create a new CrossEntropyLoss object from inherited base classes: nn, Serialization, Typing with example: obj = CrossEntropyLoss(logits_ndim, weight, reduction, ignore_index)