The best way is not to give them to the optimizer in the first place I think.
Or if you want to update them sometimes, have two optimizers, one that you step() at every iteration and one that you step() only when you want to update these special elements.