Solved by ptrblck in post #2 
              
              
                In case you are using nn.CrossEntropyLoss or nn.NLLLoss, then yes: the targets are expected as LongTensors containing the class indices in the range [0, nb_classes-1].