Open davidberard98 opened 1 week ago
a workaround: say your use case does this (which is also demonstrated in the repro):
1) script a outer module, which contains the inner module annotated as an interface 2) script the inner module, which fails because it was originally annotated as an interface.
you can work around the issue by first scripting the inner module to populate the type cache with the non-interface version of the module type.
🐛 Describe the bug
Repro is below:
Since the first torchscript-ing of the wrapper module saw the submodule as an interface type, it ignores the methods that are not part of the interface. Then we cache the type. Finally, when we torchscript the submodule on its own, we see the other methods and fail because the jit_type associated with this class doesn't have those methods.
error
Versions
main branch, CPU build
cc @EikanWang @jgong5 @wenzhe-nrv @sanchitintel