refactoring of module/object (#22203)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22203
ghimport-source-id: 6b3807ac8aa53df2fdd770b43d8e54b8f0d69c20
Test Plan: Imported from OSS
Differential Revision: D15998760
Pulled By: suo
fbshipit-source-id: dd51edbcb66561189ae9d94a129434092bcad01b