Solved by ptrblck in post #4 
              
              
                If you are dealing with a multi-class classification, you could use nn.CrossEntropyLoss as the criterion. 
I assume your model outputs logits in the shape [batch_size, nb_classes]. If that's the case, you can directly use it in the criterion and use a target tensor containing the class indices in th…