some refactor on register_distributed_ops (#38657)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/38657
Test Plan: Imported from OSS
Differential Revision: D21940442
Pulled By: wanchaol
fbshipit-source-id: c60c1ac3ede355c276e0d03fb13ff301698f6acd