class_docstr: FP16-safe cross entropy loss.
  
  This avoids overflow in the softmax by doing the operation in FP32.
class_docstr_tok: ["FP16-safe","cross","entropy","loss",".","This","avoids","overflow","in","the","softmax","by","doing","the","operation","in","FP32","."]
code: def forward(self, scores, targets):
      return F.nll_loss(
          F.log_softmax(scores, 1, dtype=torch.float32),
          targets,
          weight=self.weight,
          ignore_index=self.ignore_index,
          reduction=self.reduction,
      )
  
imports: import math
  from itertools import chain
  from typing import Optional
  import parlai.utils.logging
label_desc: Use image node_id 2 for calling the FP16SafeCrossEntropy obj's underlying member method code with example usage: obj.forward(scores, targets) and returns: F