-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Streamlining guard expect tests #94404
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
Signed-off-by: Edward Z. Yang <ezyang@meta.com> [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/94404
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 33d3071: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Signed-off-by: Edward Z. Yang <ezyangmeta.com> [ghstack-poisoned]
| # guards, and it may be helpful for user output too (be careful though; | ||
| # some equality guards are nontrivial! It would be nice to get simplified | ||
| # output to print them too) | ||
| def produce_guards(self, placeholders, sources, |
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.
I'm not sure a compilation protecting API should offer a simplified version that actively removes some of the safety. It feels like we should always emit them all, and if you need to remove simplified after, do so with a helper func.
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.
Can we cut the difference by making this a private kwarg?
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.
making it a private kwarg sounds good to me!
Changes: * Add `simplified` kwarg to let you only render guards that are nontrivial (excludes duck sizing) * Make a list of strings valid for sources, if you just have some variable names you want to bind to * Add test helper `show_guards` using these facilities, switch a few tests to it Signed-off-by: Edward Z. Yang <ezyangmeta.com> [ghstack-poisoned]
Changes: * Add `simplified` kwarg to let you only render guards that are nontrivial (excludes duck sizing) * Make a list of strings valid for sources, if you just have some variable names you want to bind to * Add test helper `show_guards` using these facilities, switch a few tests to it Signed-off-by: Edward Z. Yang <ezyangmeta.com> [ghstack-poisoned]
Changes: * Add `simplified` kwarg to let you only render guards that are nontrivial (excludes duck sizing) * Make a list of strings valid for sources, if you just have some variable names you want to bind to * Add test helper `show_guards` using these facilities, switch a few tests to it Signed-off-by: Edward Z. Yang <ezyangmeta.com> [ghstack-poisoned]
Changes: * Add `simplified` kwarg to let you only render guards that are nontrivial (excludes duck sizing) * Make a list of strings valid for sources, if you just have some variable names you want to bind to * Add test helper `show_guards` using these facilities, switch a few tests to it Signed-off-by: Edward Z. Yang <ezyangmeta.com> [ghstack-poisoned]
Changes: * Add `simplified` kwarg to let you only render guards that are nontrivial (excludes duck sizing) * Make a list of strings valid for sources, if you just have some variable names you want to bind to * Add test helper `show_guards` using these facilities, switch a few tests to it Signed-off-by: Edward Z. Yang <ezyangmeta.com> [ghstack-poisoned]
| # guards, and it may be helpful for user output too (be careful though; | ||
| # some equality guards are nontrivial! It would be nice to get simplified | ||
| # output to print them too) | ||
| def produce_guards(self, placeholders, sources, |
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.
making it a private kwarg sounds good to me!
CR on #94404 Signed-off-by: Edward Z. Yang <ezyang@meta.com> [ghstack-poisoned]
CR on #94404 Signed-off-by: Edward Z. Yang <ezyangmeta.com> [ghstack-poisoned]
Signed-off-by: Edward Z. Yang <ezyangmeta.com> ghstack-source-id: f677f95 Pull Request resolved: pytorch#94404
CR on #94404 Signed-off-by: Edward Z. Yang <ezyang@meta.com> Pull Request resolved: #94782 Approved by: https://github.com/voznesenskym
Stack from ghstack (oldest at bottom):
Changes:
simplifiedkwarg to let you only render guards that are nontrivial (excludes duck sizing)show_guardsusing these facilities, switch a few tests to itSigned-off-by: Edward Z. Yang ezyang@meta.com