Solved by KFrank in post #2 
              
              
                Hi Richie! 

Yes.  CrossEntropyLoss supports what it calls the “K-dimensional case.” 
Note, pytorch’s CrossEntropyLoss does not accept a one-hot-encoded 
target – you have to use integer class labels instead. 
Let’s call your value 23 length.  Your input (the prediction generated 
by your network) s…