You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While the snippet posted in that issue does work now, there still seems to be a failure mode when nested modules (all of which are runtime type checked) are used.
Looking at nn.Module's _ParentType, indeed the type of the argument to parent is expected to be Type[nn.Module] so a class, rather than an instance of nn.Module which is what is actually being passed in. This seems to have been the problem for the previously reported instance of this issue in #3224 , since the PR that fixes it (#3371) changed the type annotation from Type[Scope] to simply Scope, to adjust the expectation from a class being provided to an instance.
The text was updated successfully, but these errors were encountered:
Related issue: #3224
While the snippet posted in that issue does work now, there still seems to be a failure mode when nested modules (all of which are runtime type checked) are used.
Colab Link
This snippet fails with the following error:
Looking at nn.Module's _ParentType, indeed the type of the argument to
parent
is expected to beType[nn.Module]
so a class, rather than an instance ofnn.Module
which is what is actually being passed in. This seems to have been the problem for the previously reported instance of this issue in #3224 , since the PR that fixes it (#3371) changed the type annotation fromType[Scope]
to simplyScope
, to adjust the expectation from a class being provided to an instance.The text was updated successfully, but these errors were encountered: