-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Mark more methods of DispatchKeySet as constexpr #78558
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
Added operator-, DispatchKeySet::add, and DispatchKeySet::remove. I wanted to use these in functorch to make a constexpr DispatchKeySet. Also adds C10_NODISCARD to DispatchKeySet::remove to make it consistent with DispatchKeySet::add (this will raise a warning if someone calls remove without assigning the result to a variable; remove is NOT mutable and this is a pitfall that I run into a lot) Test Plan: - wait for tests [ghstack-poisoned]
🔗 Helpful links
✅ No Failures (0 Pending)As of commit f61bb43 (more details on the Dr. CI page): Expand to see more💚 💚 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. |
Added operator-, DispatchKeySet::add, and DispatchKeySet::remove. I wanted to use these in functorch to make a constexpr DispatchKeySet. Also adds C10_NODISCARD to DispatchKeySet::remove to make it consistent with DispatchKeySet::add (this will raise a warning if someone calls remove without assigning the result to a variable; remove is NOT mutable and this is a pitfall that I run into a lot) Test Plan: - wait for tests ghstack-source-id: f2b030a Pull Request resolved: #78558
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.
lgtm pending CI
|
@pytorchbot merge this please |
|
Hey @zou3519. |
Summary: Added operator-, DispatchKeySet::add, and DispatchKeySet::remove. I wanted to use these in functorch to make a constexpr DispatchKeySet. Also adds C10_NODISCARD to DispatchKeySet::remove to make it consistent with DispatchKeySet::add (this will raise a warning if someone calls remove without assigning the result to a variable; remove is NOT mutable and this is a pitfall that I run into a lot) Pull Request resolved: #78558 Approved by: https://github.com/bdhirsh Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/de5a2320f26f542a9e5a1999cf4917e9796a44f2 Test plan from GitHub: - wait for tests Reviewed By: b0noI Differential Revision: D36854229 Pulled By: zou3519 fbshipit-source-id: 1fef207153409b6978bff9b3da5e969c84db6fc0
Stack from ghstack:
Added operator- and DispatchKeySet::add.
I wanted to use these in functorch to make a constexpr DispatchKeySet.
Also adds C10_NODISCARD to DispatchKeySet::remove to make it
consistent with DispatchKeySet::add (this will raise a
warning if someone calls remove without assigning the result to a
variable; remove is NOT mutable and this is a pitfall that I run into a
lot)
Test Plan: