@ pechyonkin



 ptrblck:

If you have parameters in your model, which should be saved and restored in the state_dict , but not trained by the optimizer, you should register them as buffers.


If your self.some_params are nn.Parameter objects, then you don’t have to worry about this.  If they’re tensors, then they won’t be in the state_dict (unless registered as buffer).