enables module modification during repackaging (#71520)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/71520
Specifically this pr is to deal with adverse cases such as D33662192
It is possible for someone to export a package, change something in it, and then attempt to repackage it. In this case it's possible that dependencies of the package are no longer interned. In this case it is not obvious where we would look for these packages, therefore, we throw an error.
Test Plan: Imported from OSS
Reviewed By: bradleyhd
Differential Revision: D33675557
Pulled By: PaliC
fbshipit-source-id: 807962bfb340d30d418617d6e78661a033828314
(cherry picked from commit 1b10c238070c25748f3f3f83c999079d498e94a2)