Add return type hint and improve the docstring of consume_prefix_in_state_dict_if_present method (#63388)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63388
Context: https://discuss.pytorch.org/t/how-to-use-the-helper-function-consume-prefix-in-state-dict-if-present/129505/3
Make it clear that this method strips the prefix in place rather than returns a new value.
Additional reformatting is also applied.
ghstack-source-id: 135973393
Test Plan: waitforbuildbot
Reviewed By: rohan-varma
Differential Revision: D30360931
fbshipit-source-id: 1a0c7967a4c86f729e3c810686c21dec43d1dd7a