Thank you so much!
I noticed that if i do what you did which is defining criterion = nn.CrossEntropyLoss(), it works perfectly.
But if i just do loss =  nn.CrossEntropyLoss(output, y) it throws that error I mentioned. Must be some strange implementation thing i guess…
Once again, Thank you so much.