Optimizer can’t take parameters with requires_grad=False. It will throw an error. But in your case, you haven’t really freezed the parameters. There is a typo in the code. It should be param.requires_grad=False not param.required_grad. Since your parameters still has requires_grad=True, it won’t throw an error when creating an optimizer. Consequently, It will also optimize the parameters.
I am surprised why it didn’t throw an error (I checked, this doesn’t throw error in 0.4.0 as well). Also, it’s RMSprop not RSMprop.
@albanD can you please have a look?