


ret = rref.rpc_async().static_async_add("worker2", torch.ones(2), 1, 2).wait()
      >>> print(ret)  # prints tensor([4., 4.])
      >>>
      >>> rref = rpc.remote("worker1", AsyncExecutionClass)
      >>> ret = rref.remote().static_async_add("worker2", torch.ones(2), 1, 2).to_here()
      >>> print(ret)  # prints tensor([4., 4.])



Backends
The RPC module can leverage different backends to perform the
communication between the nodes. The backend to be used can be
specified in the "init_rpc()" function, by passing a certain value of
the "BackendType" enum. Regardless of what backend is used, the rest
of the RPC API won't change. Each backend also defines its own
subclass of the "RpcBackendOptions" class, an instance of which can
also be passed to "init_rpc()" to configure the backend's behavior.
class torch.distributed.rpc.BackendType(value)
An enum class of available backends.
PyTorch ships with a builtin "BackendType.TENSORPIPE" backend.