Solved by chetan_patil in post #2 
              
              
                Consider you have simple classifier whose input size is [20,5] with 20 being the batch_size. After you forward the input to the model, it will give the output of size [20, num_classes]. 
Now, when you calculate the loss using the nn.CrossEntropyLoss() or nn.MSELoss(), you have an argument reduction,…