-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Register torch.return_types.* as pytree nodes #75915
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
Conversation
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit 4b8657a (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
518ffd6 to
037dc1e
Compare
| _register_pytree_node(tuple, _tuple_flatten, _tuple_unflatten) | ||
| _register_pytree_node(namedtuple, _namedtuple_flatten, _namedtuple_unflatten) | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kill this fuzz
|
I would like to know if there's a more proper way to check structseq but I wouldn't block this on it |
All of the torch.return_types.* are these special things "structseq" that subclass tuple but have a different constructor from tuple :(. This PR iterates through all of torch.return_types.* and adds a pytree registration for them. Test Plan: - add tests for max and min which return torch.return_types.max, and torch.return_types.min, respectively. There's not an easy way to "get all torch ops that return a return_types object".
037dc1e to
4b8657a
Compare
I'll file a followup issue |
|
@pytorchbot merge this please |
|
Hey @zou3519. |
Summary: All of the torch.return_types.* are these special things "structseq" that subclass tuple but have a different constructor from tuple :(. This PR iterates through all of torch.return_types.* and adds a pytree registration for them. Pull Request resolved: #75915 Approved by: https://github.com/ezyang, https://github.com/kshitij12345 Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/18c74d10bbec7728c22e7868caa880c5d4189c1a Test plan from GitHub: - add tests for max and min which return torch.return_types.max, and torch.return_types.min, respectively. There's not an easy way to "get all torch ops that return a return_types object". Fixes #75218 Reviewed By: seemethere Differential Revision: D35751456 Pulled By: zou3519 fbshipit-source-id: 88a5289019eb4f5642f8e9ece6791581a0f2b7a9
All of the torch.return_types.* are these special things "structseq" that subclass tuple but have a different constructor from tuple :(. This PR iterates through all of torch.return_types.* and adds a pytree registration for them. Test Plan: - add tests for max and min which return torch.return_types.max, and torch.return_types.min, respectively. There's not an easy way to "get all torch ops that return a return_types object". Fixes #75218 Pull Request resolved: #75915 Approved by: https://github.com/ezyang, https://github.com/kshitij12345 (cherry picked from commit 18c74d1)
All of the torch.return_types.* are these special things "structseq"
that subclass tuple but have a different constructor from tuple :(.
This PR iterates through all of torch.return_types.* and adds a pytree
registration for them.
Test Plan:
torch.return_types.min, respectively. There's not an easy way to
"get all torch ops that return a return_types object".
Fixes #75218