Solved by mMagmer in post #2 
              
              
                you can reduce output of loss function yourself  or use reduction='sum'   instead of reduction='mean'. this way your orverall loss is proportional to number of samples in each batchs. 
CrossEntropyLoss: 



reduction (string , optional) – Specifies the reduction to apply to the output: 'none' | 'mea…