Preserve submodule with __set_state__ in freezing (#47308)
Summary:
This PR does the following:
- fail freezing if input module has __set_state__ method
- preserves attributes of submodules with __set_state__ method.
Fixes #{issue number}
Pull Request resolved: https://github.com/pytorch/pytorch/pull/47308
Reviewed By: eellison
Differential Revision: D24711613
Pulled By: bzinodev
fbshipit-source-id: 22e51417454aaf85cc0ae4acb2dc7fc822f149a2