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 #4120

Merged
merged 1 commit into from
Aug 21, 2024
Merged

Conversation

dcharatan
Copy link
Contributor

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

What does this PR do?

Fixes #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.
Copy link

google-cla bot commented Aug 6, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 0.00%. Comparing base (31adb00) to head (967353f).
Report is 119 commits behind head on main.

Files Patch % Lines
flax/linen/module.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##            main   #4120    +/-   ##
======================================
  Coverage   0.00%   0.00%            
======================================
  Files        106     109     +3     
  Lines      13582   14216   +634     
======================================
- Misses     13582   14216   +634     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@copybara-service copybara-service bot merged commit 54634f7 into google:main Aug 21, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
3 participants