[OpInfo] Added ReductionOpInfo subclass of OpInfo and ported sum test (#62737)
authorHeitor Schueroff <heitorschueroff@fb.com>
Thu, 26 Aug 2021 13:05:28 +0000 (06:05 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 26 Aug 2021 13:06:38 +0000 (06:06 -0700)
commit774ae0851d98829b412e46dde85e716dad065a06
treefc13608b0d02002c064af677eb33313d5cf32cd5
parentc02eda8166068400a9e5d82343108cd8a524095c
[OpInfo] Added ReductionOpInfo subclass of OpInfo and ported sum test (#62737)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62737

ReductionOpInfo is a specialization of OpInfo for reduction operators. For now, it is designed to work with reductions that return a single tensor and that reduce all elements along one or more dimensions to a single value. In particular this excludes operators such as `max` and `min` that return multiple tensors and `quantile` that can return multiple values.

fixes https://github.com/pytorch/pytorch/issues/49746

Test Plan: Imported from OSS

Reviewed By: ejguan

Differential Revision: D30406568

Pulled By: heitorschueroff

fbshipit-source-id: 218b1da1902f67bcf4c3681e2a0f0029a25d51f1
test/test_ops.py
test/test_reductions.py
torch/testing/_internal/common_methods_invocations.py