Skip to content

Conversation

@zou3519
Copy link
Contributor

@zou3519 zou3519 commented May 31, 2022

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:

  • wait for tests

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]
@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented May 31, 2022

🔗 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.

Click here to manually regenerate this comment.

zou3519 added a commit that referenced this pull request May 31, 2022
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
@zou3519 zou3519 requested a review from bdhirsh May 31, 2022 19:04
Copy link
Contributor

@bdhirsh bdhirsh left a comment

Choose a reason for hiding this comment

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

lgtm pending CI

@zou3519
Copy link
Contributor Author

zou3519 commented Jun 1, 2022

@pytorchbot merge this please

@github-actions
Copy link
Contributor

github-actions bot commented Jun 1, 2022

Hey @zou3519.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

@zou3519 zou3519 added the topic: not user facing topic category label Jun 1, 2022
bigfootjon pushed a commit that referenced this pull request Jun 2, 2022
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
@facebook-github-bot facebook-github-bot deleted the gh/zou3519/420/head branch June 5, 2022 14:17
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.

4 participants