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] fix iter_nodes #3889

Merged
merged 1 commit into from
May 9, 2024
Merged

[nnx] fix iter_nodes #3889

merged 1 commit into from
May 9, 2024

Conversation

cgarciae
Copy link
Collaborator

What does this PR do?

  • iter_nodes now returns leaves first, this makes surgery less error prone.
  • exposes iter_nodes as nnx.iter_nodes

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.43%. Comparing base (2c7d7cd) to head (90c2687).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3889   +/-   ##
=======================================
  Coverage   60.43%   60.43%           
=======================================
  Files         105      105           
  Lines       13263    13264    +1     
=======================================
+ Hits         8015     8016    +1     
  Misses       5248     5248           

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

@cgarciae cgarciae requested a review from superbobry May 8, 2024 14:04
Copy link
Member

@superbobry superbobry left a comment

Choose a reason for hiding this comment

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

I would recommend adding a few more sentences to the PR description for posterity, explaining how this change makes surgery less error-prone.

@@ -1072,11 +1072,11 @@ def _iter_nodes(
if id(node) in visited:
Copy link
Member

Choose a reason for hiding this comment

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

Please add a docstring to iter_nodes explaining the iteration order, since that function is now public.

@copybara-service copybara-service bot merged commit a680767 into main May 9, 2024
21 checks passed
@copybara-service copybara-service bot deleted the nnx-fix-iter-nodes branch May 9, 2024 17:01
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