[TensorPipe] Use registry for transports and channels (#39957)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/39957
In order to provide a pluggable and extendable way to add new transports and channels to the TensorPipe agent, we use two registries. This allows us to separate the specific details of each backend (e.g., how it determines what address to use) from the generic logic of setting up TensorPipe.
Test Plan: Built `//caffe2:ifbpy` on two devservers, one in CLN and the other in PRN, and ran RPC across them.
Differential Revision: D22017614
fbshipit-source-id: 4ea7e6ed004a69187666f41bf59858e8174fde0d