Solved by ptrblck in post #5 
              
              
                If you are working on a multi-class classification, which I assume since you are using the CIFAR10 dataset, then the target is expected in the shape [batch_size] containing the class indices in the range [0, nb_classes-1], so it’s not one-hour encoded. 
The torchvision.datasets` CIFAR10 dataset will…