The code should update the model parameters, if you’ve previously passed them to the optimizer.
You can print a specific parameter before and after the optimizer.step() operation and compare the values to make sure it’s working as intended.
PS: you can post code snippets by wrapping them into three backticks ```, which would make debugging easier.