Add RRef support to ShardedTensor. (#59776)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/59776
Overall design: https://github.com/pytorch/pytorch/issues/55207.
In this PR, I've added support to ShardedTensor such that it also creates RRefs
pointing to the remote shards if the RPC framework is initialized.
As a result, this provides more flexiblity for ShardedTensor such that users
can use collectives with local shards or use the RPC framework to interact with
remote shards.
ghstack-source-id: 131381914
Test Plan:
1) unit tests
2) waitforbuildbot
Reviewed By: SciPioneer
Differential Revision: D29020844
fbshipit-source-id: acb308d0029a5e486c464d93189b5de1ba680c85