I want to draw loss per epoch from the example https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html#sphx-glr-beginner-blitz-cifar10-tutorial-py 259
The log file is
Out:

[1,  2000] loss: 2.173
[1,  4000] loss: 1.839
[1,  6000] loss: 1.659
[1,  8000] loss: 1.600
[1, 10000] loss: 1.533
[1, 12000] loss: 1.468
[2,  2000] loss: 1.395
[2,  4000] loss: 1.378
[2,  6000] loss: 1.368
[2,  8000] loss: 1.340
[2, 10000] loss: 1.316
[2, 12000] loss: 1.307
Finished Training


where the first column is the epoch number. So if I want to draw the loss per epoch, do I need to average the loss when they have same epoch number? It will be
Epoch   Loss
1          (2.173+1.839+1.659+1.600+1.533+1.468)/6
2         ...

Have you have more simple way in pytorch?