docstr: Apply `F.log_softmax` on output then blend the loss/num_classes(`c`) with the `F.nll_loss`
docstr_tok: ["Apply","`","F.log_softmax","`","on","output","then","blend","the","loss\/num_classes","(","`","c","`",")","with","the","`","F.nll_loss","`"]
code: def forward(self, output: Tensor, target: Tensor) -> Tensor:
      "Apply `F.log_softmax` on output then blend the loss/num_classes(`c`) with the `F.nll_loss`"
      c = output.size()[1]
      log_preds = F.log_softmax(output, dim=1)
      if self.reduction == "sum":
          loss = -log_preds.sum()
      else:
          loss = -log_preds.sum(
              dim=1
          )  # We divide by that size at the return line so sum and not mean
          if self.reduction == "mean":
              loss = loss.mean()
      return loss * self.eps / c + (1 - self.eps) * F.nll_loss(
          log_preds,
          target.long(),
          weight=self.weight,
          reduction=self.reduction,
      )
  
imports: from __future__ import annotations
  from .imports import *
  from .torch_imports import *
  from .torch_core import *
  from .layers import *
label_desc: Use image node_id 2 for calling the LabelSmoothingCrossEntropy obj's underlying member method code with example usage: obj.forward(output, target) and returns: unknown