In the current implementation(task.py), running_loss is initialized outside the epoch loop and accumulates the loss across all epochs. However, when calculating the average at the end, it is divided only by len(trainloader) (the number of batches in a single epoch).
While the default configuration uses epochs = 1 (making the current calculation correct), if a user increases the epochs hyperparameter, the reported avg_trainloss will be scaled up by a factor of epochs.