If you set the requires_grad field of these parameters to False before doing anything with them. Then their .grad field will be None. And they won’t be updated.

Can you change the behaviour to check for if not p.requires_grad: ?

This would be a major breaking change. I don’t think we can do that