Skip to content

fix: Implement aten.mean.default and aten.mean.dim converters #1810

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Apr 21, 2023

Conversation

gs-olive
Copy link
Collaborator

@gs-olive gs-olive commented Apr 6, 2023

Description

  • Replace existing implementation of aten.mean.dim with general version invoking centralized add_reduce_layer utility
  • Add implementation of aten.mean.default by refactoring default case to be a special invocation of aten.mean.dim (specifically, one with dim being all dimensions in the Tensor and keepdim being False).
  • Add defaults for optional arguments in converters
  • Add test cases for combinations of input options to the converters

Fixes #1742
Addresses First Bug in #1740

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • [ x ] My code follows the style guidelines of this project (You can use the linters)
  • [ x ] I have performed a self-review of my own code
  • [ x ] I have commented my code, particularly in hard-to-understand areas and hacks
  • [ x ] I have made corresponding changes to the documentation
  • [ x ] I have added tests to verify my fix or my feature
  • [ x ] New and existing unit tests pass locally with my changes
  • [ x ] I have added the relevant labels to my PR in so that relevant reviewers are notified

- Replace existing implementation of aten.mean.dim with general version
invoking centralized `add_reduce_layer` utility
- Add implementation of aten.mean.default by refactoring default case to
be a special invocation of aten.mean.dim (specifically, one with `dim`
being all dimensions in the Tensor and `keepdim` being False).
- Add defaults for optional arguments in converters
- Add test cases for combinations of input options to the converters
@gs-olive gs-olive force-pushed the aten_mean_converter branch from f9c46da to 2347441 Compare April 18, 2023 03:24
@gs-olive
Copy link
Collaborator Author

gs-olive commented Apr 18, 2023

Removed dependency on other PR, made this a standalone converter addition. @wushirong @frank-wei

Copy link
Collaborator

@narendasan narendasan left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@frank-wei frank-wei left a comment

Choose a reason for hiding this comment

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

LGTM!

@gs-olive gs-olive merged commit b3f433a into pytorch:main Apr 21, 2023
@gs-olive gs-olive deleted the aten_mean_converter branch April 21, 2023 20:40
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 [Bug] aten.mean.dim converter throws error despite being supported
4 participants