Solved by KFrank in post #3 
              
              
                Hello Gurgaon! 

You are correct that the named weight argument is the way to 
provide class weights to nn.CrossEntropyLoss. 
But the weights you use in your example don’t make a lot of 
sense to me.  The weights you give for classes B and C are 
not very different – they are 0.91 and 0.99, respecti…