CrossEntropyLoss
class torch.nn.CrossEntropyLoss(weight=None, size_average=None, ignore_index=- 100, reduce=None, reduction='mean', label_smoothing=0.0)
This criterion computes the cross entropy loss between input logits
   and target.
It is useful when training a classification problem with C
   classes. If provided, the optional argument "weight" should be a 1D
   Tensor assigning weight to each of the classes. This is
   particularly useful when you have an unbalanced training set.
The input is expected to contain the unnormalized logits for each
   class (which do not need to be positive or sum to 1, in general).
   input has to be a Tensor of size (C) for unbatched input,
   (minibatch, C) or (minibatch, C, d_1, d_2, ..., d_K) with K \geq 1
   for the K-dimensional case. The last being useful for higher
   dimension inputs, such as computing cross entropy loss per-pixel
   for 2D images.
The target that this criterion expects should contain either: