Your training loop misses the optimizer.step() call so the parameters of your model won’t be updated.
I would recommend to take a look at the tutorials and play around with some of these models and training loops first.
PS: you can post code snippets by wrapping them into three backticks ```, which makes debugging easier.