Solved by ptrblck in post #2 
              
              
                It depends how you would like to print the running loss value. 
In the first example the current loss average of the batch will be added to running_loss, printed after 2000 iterations and reset. 
The second example prints the loss for the complete epoch and is a bit more accurate. 
Depending on the …