-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Fix noop_with_empty_axes in reduce ops #7394
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
Fix noop_with_empty_axes in reduce ops #7394
Conversation
Signed-off-by: Ti-Tai Wang <titaiwang@microsoft.com>
ba2a8bc to
d39343c
Compare
Signed-off-by: Ti-Tai Wang <titaiwang@microsoft.com>
justinchuby
left a comment
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.
Thanks! cc @fdwr for another eye
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7394 +/- ##
==========================================
+ Coverage 54.43% 54.45% +0.02%
==========================================
Files 511 511
Lines 31892 31876 -16
Branches 2876 2868 -8
==========================================
- Hits 17360 17359 -1
+ Misses 13741 13734 -7
+ Partials 791 783 -8 ☔ View full report in Codecov by Sentry. |
fdwr
left a comment
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.
👍 Thanks Ti-Tai.
| def handle_axes(self, axes, noop_with_empty_axes=False): # noqa: PLR0911 | ||
| if isinstance(axes, tuple): | ||
| if len(axes) == 0: | ||
| if len(axes) == 0 and not noop_with_empty_axes: |
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.
So: I guess the numpy convention is that axes=None means reduce over all axes?
Follow up to #7394 : improving the documentation. (The documentation seems to have undergone several changes, please let me know if you have any concerns with the wording.) --------- Signed-off-by: Ganesan Ramalingam <grama@microsoft.com> Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: justinchuby <11205048+justinchuby@users.noreply.github.com>
Fixes #6103
Credits to: https://github.com/fdwr