Solved by ptrblck in post #2 
              
              
                Your labels tensor seems to already contain class indices but has an additional unnecessary dimension. 
The right approach would be to use labels = labels.squeeze(1) and pass it to the criterion. 
Using torch.max(labels, dim=1)[0]  would yield the same output. 
However, torch.max(labels, dim=1)[1] w…