I was too slow…
But if you are interested in a nice introductory tutorial, which helped me understand the basics, take a look at this medium article:
https://towardsdatascience.com/understanding-pytorch-with-an-example-a-step-by-step-tutorial-81fc5f8c4e8e 2
I covers exactly the problem you were having and goes a bit more into detail about what is happening.