-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[torch/utils][Code Clean] Clean asserts in torch/utils/*.py
#165410
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
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/165410
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Cancelled Job, 32 Pending, 1 Unrelated FailureAs of commit f777fe6 with merge base c5972eb ( NEW FAILURE - The following job has failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@pytorchbot label "module: python frontend" "module: error checking" "topic: not user facing" |
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.
A few small things, but looks pretty good overall!
torch/utils/_config_module.py
Outdated
or self.env_name_force is not None | ||
): | ||
raise AssertionError( | ||
"if alias is set, none of {default, justknob and env var} can be set" |
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.
missing f ?
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.
No. The message is as is. If an error is raised here, both the if-branch and the message are shown and user can know, oh one of
self.default is not _UNSET_SENTINEL
or self.justknob is not None
or self.env_name_default is not None
or self.env_name_force is not None
is not fulfilled. BTW, most of them are None when error raised.
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.
Ho I read too fast, my bad!
@albanD Thanks for your reviewing! All mentioned nits are fixed. PTAL again. |
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.
Looks great!
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…h#165410) Including: - `torch/utils/*.py` Fixes part of pytorch#164878 Pull Request resolved: pytorch#165410 Approved by: https://github.com/albanD
…h#165410) Including: - `torch/utils/*.py` Fixes part of pytorch#164878 Pull Request resolved: pytorch#165410 Approved by: https://github.com/albanD
@pytorchbot revert -m "sorry I'm going to revert this since I want to try to back out some other things that are conflicting with this, there is nothing wrong with this PR, rebasing and resolving the merge conflicts should be enough, sorry for the churn" -c weird |
@pytorchbot successfully started a revert job. Check the current status here. |
…#165410)" This reverts commit e20c9bf. Reverted #165410 on behalf of https://github.com/clee2000 due to sorry I'm going to revert this since I want to try to back out some other things that are conflicting with this, there is nothing wrong with this PR, rebasing and resolving the merge conflicts should be enough, sorry for the churn ([comment](#165410 (comment)))
@KarhouTam your PR has been successfully reverted. |
This PR was reopened (likely due to being reverted), so your approval was removed. Please request another review.
Including:
torch/utils/*.py
Fixes part of #164878
cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @jerryzh168 @malfet @albanD