Solved by ptrblck in post #2 
              
              
                Your total_loss consists of the losses of all samples in your Dataset. Usually you print the average loss per sample. To do this, you could divide total_loss by len(train_set).