pytorch
19a6487a - [state_dict][6/N] Change API names to avoid conflict and simplify the API signatures (#111120)

Commit
1 year ago
[state_dict][6/N] Change API names to avoid conflict and simplify the API signatures (#111120) `state_dict` is a very common variable name people use to represent a local state_dict and `load_state_dict` conflicts with DCP's `load_state_dict`. This PR changes `state_dict` to `get_state_dict`. `get_state_dict` is more close to what is this API does -- users use the API to get the current state_dict for saving or for loading (passed to DCP for loading in-place).. This PR also changes `load_state_dict` to `set_state_dict`. `set_state_dict` is less ideal compared to `get_state_dict` but is symetric. We can still change the API name before it goes to beta. This PR also simplies the API signatures. `model_only` is removed and `optim_only` only exists for `get_state_dict`. Differential Revision: [D50213931](https://our.internmc.facebook.com/intern/diff/D50213931/) Pull Request resolved: https://github.com/pytorch/pytorch/pull/111120 Approved by: https://github.com/wz337 ghstack dependencies: #111106, #111107, #111275, #111109, #111110
Author
Committer
Parents
Loading