fix acc topk's handling of the case when dim=0, fix tests as well (#64727)
authorEmad El-Haraty <elharaty@fb.com>
Thu, 9 Sep 2021 17:32:22 +0000 (10:32 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 9 Sep 2021 17:35:23 +0000 (10:35 -0700)
commit46c886e8a6d3d9f502fa8c0985784436ab7f9543
tree8c9c0e2dac7c1762e09a56870b5263ba4baa4d8d
parent3d3ff4a9e709f709aa65e85b67364452b0223ef8
fix acc topk's handling of the case when dim=0, fix tests as well (#64727)

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

the acc ops convertor for topk has a subtle bug (i found this while trying to introduce max/min)
the code does not differentiate between dim == None and dim ==0, but these are both different computations

Reviewed By: jfix71, 842974287

Differential Revision: D30833621

fbshipit-source-id: 6cd84e6ca4e95bb1a6d6465e61830b76808a9c78
torch/fx/experimental/fx2trt/converters/acc_ops_converters.py