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

Improve Typing support #3242

Merged
merged 5 commits into from
Aug 11, 2023
Merged

Improve Typing support #3242

merged 5 commits into from
Aug 11, 2023

Conversation

cgarciae
Copy link
Collaborator

@cgarciae cgarciae commented Jul 31, 2023

What does this PR do?

  • Makes AxisMetadata generic over the unbox type and improves some method signatures.
  • Adds overload signatures for Module.param, Module.variable, Module.apply, Scope.param, and Scope.variable.

@cgarciae cgarciae marked this pull request as ready for review July 31, 2023 20:36
@cgarciae cgarciae requested a review from levskaya July 31, 2023 20:37
Copy link
Collaborator

@levskaya levskaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - but I think we need to do the same thing for scope.variable and self.variable ?

@codecov-commenter
Copy link

codecov-commenter commented Aug 1, 2023

Codecov Report

Merging #3242 (36e5141) into main (675e34d) will decrease coverage by 0.14%.
Report is 3 commits behind head on main.
The diff coverage is 73.97%.

@@            Coverage Diff             @@
##             main    #3242      +/-   ##
==========================================
- Coverage   82.35%   82.21%   -0.14%     
==========================================
  Files          54       54              
  Lines        6087     6147      +60     
==========================================
+ Hits         5013     5054      +41     
- Misses       1074     1093      +19     
Files Changed Coverage Δ
flax/linen/module.py 91.33% <67.64%> (-1.13%) ⬇️
flax/core/scope.py 88.91% <68.00%> (-1.14%) ⬇️
flax/core/meta.py 95.40% <100.00%> (+0.10%) ⬆️
flax/linen/attention.py 96.06% <100.00%> (ø)

@copybara-service copybara-service bot merged commit 5030149 into main Aug 11, 2023
18 checks passed
@copybara-service copybara-service bot deleted the improve-typing branch August 11, 2023 08:59
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.

3 participants