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

Add rule for deprecated _register_pytree_node #44

Merged
merged 3 commits into from Apr 22, 2024
Merged

Conversation

ZainRizvi
Copy link
Contributor

@ZainRizvi ZainRizvi commented Apr 22, 2024

Fixes #41

Testing:

  • Added unit tests
  • Ran torchfix against a directory that used this deprecated function and verified that the func was only caught after the change

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 22, 2024
Copy link
Contributor

@kit1980 kit1980 left a comment

Choose a reason for hiding this comment

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

Please remove import torch.utils._pytree._register_pytree_node as yy, as you can only import packages, not individual functions.

@@ -0,0 +1,9 @@
from torch.utils._pytree import register_pytree_node, _register_pytree_node
Copy link
Contributor

Choose a reason for hiding this comment

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

I hoped it would no longer import _register_pytree_node...
(Not for this PR, but an issue for the future).

@ZainRizvi ZainRizvi merged commit a71baf1 into main Apr 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule for deprecated _register_pytree_node
3 participants