[fix] ReduceOps throw error if dim is repeated (#44281)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/44273
TODO
* [x] Add test
Pull Request resolved: https://github.com/pytorch/pytorch/pull/44281
Reviewed By: zhangguanheng66
Differential Revision: D23569004
Pulled By: ezyang
fbshipit-source-id: 1ca6523fef168c8ce252aeb7ca418be346b297bf