Solved by ptrblck in post #2 
              
              
                I think you should also pass the predictions as a hot encoded tensor. 
If you pass the argmax as the prediction, it will be internally broadcasted to something like this (line of code): 
num_features, num_hidden, num_classes = 5, 20, 10
batch_size = 10

features = torch.randn(batch_size, num_feature…