Solved by ptrblck in post #2 
              
              
                You are using it correctly! 
However, I think there is an explanation missing on how size_average works regarding the weight in the docs. 
Have a look at the docs of NLLLoss. It states, that each loss will be divided by the sum of all corresponding class weights, if reduce=True and size_average=True.…