class_docstr: Computes a cross-entropy loss, normalized by the number of valid (non-pad) tokens.
  Uses an efficient implementation for label smoothing and avoids the obscure SoftmaxOutput op.
class_docstr_tok: ["Computes","a","cross-entropy","loss",",","normalized","by","the","number","of","valid","(","non-pad",")","tokens",".","Uses","an","efficient","implementation","for","label","smoothing","and","avoids","the","obscure","SoftmaxOutput","op","."]
code: def forward(
      self, logits: pt.Tensor, labels: pt.Tensor
  ) -> Tuple[pt.Tensor, pt.Tensor]:
      ce = self._ce_impl(logits, labels)
      return ce, pt.ones(1, device=ce.device)
  
imports: import logging
  import math
  from abc import ABC, abstractmethod
  from typing import Any, Dict, Optional, Tuple
  import torch
  import numpy
  from .None import constants
  from .None import utils
label_desc: Use image node_id 5 for calling the CrossEntropyLoss obj's underlying member method code with example usage: obj.forward(logits, labels) and returns: ce,  pt