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

[nnx] improve toy examples #3813

Merged
merged 1 commit into from
Apr 2, 2024
Merged

Conversation

cgarciae
Copy link
Collaborator

@cgarciae cgarciae commented Apr 2, 2024

What does this PR do?

Improves toy examples, makes them more idiomatic according to current standards.

counts_ = updates.extract(Count)
model = static.merge(params, counts)
y_pred = model(x)
_counts = model.extract(Count)
Copy link
Member

Choose a reason for hiding this comment

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

Why the _ prefix? It is normally used (by convention) to indicate that a variable is unused, but here this isn't the case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should we keep counts_ then? Here we need a new variable name, cannot reuse counts.

Copy link
Member

Choose a reason for hiding this comment

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

extracted_counts or new_counts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

new_counts it is

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.04%. Comparing base (5d9fd9f) to head (6d638e6).
Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3813      +/-   ##
==========================================
+ Coverage   60.86%   61.04%   +0.18%     
==========================================
  Files         105      105              
  Lines       13045    13098      +53     
==========================================
+ Hits         7940     7996      +56     
+ Misses       5105     5102       -3     

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

@copybara-service copybara-service bot merged commit ea7f9df into main Apr 2, 2024
21 checks passed
@copybara-service copybara-service bot deleted the nnx-improve-lifted-example branch April 2, 2024 16:47
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