Running_loss _inquire

Hi, I am following this tutorial “https://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html
at first, I wonder why the loss.item() was multiplied by the batch_size when calculating the running loss.
running_loss += loss.item() * inputs.size(0)

Have a look at this post where this question was answered. :wink:

1 Like