class_docstr: Cross entropy loss that can accommodate smoothed labels
class_docstr_tok: ["Cross","entropy","loss","that","can","accommodate","smoothed","labels"]
code: def forward(self, input: Tensor, target: Tensor) -> Tensor:
      if len(target.shape) > 1:
          log_probs = F.log_softmax(input, 1)
          # TODO: Implement weight and ignore_index
          return -torch.mean(torch.sum(log_probs * target, dim=1))
      else:
          return F.cross_entropy(
              input,
              target,
              weight=self.weight,
              ignore_index=self.ignore_index,
          )
  
imports: from dataclasses import dataclass
  from typing import List, Optional, Union
  import torch
  import torch.nn.functional
  from classy_vision.generic.util import is_on_gpu
  from classy_vision.losses import ClassyLoss, register_loss
  from torch import nn, Tensor
  from vissl.config import AttrDict
label_desc: Use image node_id 1 for calling the SmoothCrossEntropy obj's underlying member method code with example usage: obj.forward(input, target) and returns: unknown, F