Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix _ParentType annotation #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix _ParentType annotation #1

wants to merge 1 commit into from

Conversation

dcharatan
Copy link
Owner

Fixes definition of _ParentType so that runtime type checkers work with nested Flax modules.

What does this PR do?

Fixes google#3756. The parents that _ParentType refers to are instances of classes, not the classes themselves, so type[Module] and type[_Sentinel] should become Module and _Sentinel respectively.

Checklist

  • This PR fixes a minor issue (e.g.: typo or small bug) or improves the docs (you can dismiss the other
    checks if that's the case).
  • This change is discussed here

Fix definition of `_ParentType` so that runtime type checkers work with nested Flax modules.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flax.linen.module.init still fails under dynamic type checking for nested modules
1 participant