# tensorplay.distributed.rpc API Source: https://www.tensorplay.cn/docs/api/tensorplay.distributed.rpc.html ## Functions 14 [#](#api-tensorplay.distributed.rpc.backend_registered) ### backend_registered function[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.backend_registered.html) ```python tensorplay.distributed.rpc.backend_registered(backend_name: str) → bool ``` [#](#api-tensorplay.distributed.rpc.construct_rpc_backend_options) ### construct_rpc_backend_options function[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.construct_rpc_backend_options.html) ```python tensorplay.distributed.rpc.construct_rpc_backend_options(backend: Any, rpc_timeout: float = 60.0, init_method: str = 'env://', **kwargs: Any) → Any ``` [#](#api-tensorplay.distributed.rpc.get_rpc_timeout) ### get_rpc_timeout function[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.get_rpc_timeout.html) ```python tensorplay.distributed.rpc.get_rpc_timeout() → float ``` [#](#api-tensorplay.distributed.rpc.get_worker_info) ### get_worker_info function[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.get_worker_info.html) ```python tensorplay.distributed.rpc.get_worker_info(worker_name: Any = None) → WorkerInfo ``` [#](#api-tensorplay.distributed.rpc.init_backend) ### init_backend function[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.init_backend.html) ```python tensorplay.distributed.rpc.init_backend(backend: Any, *args: Any, **kwargs: Any) → Any ``` [#](#api-tensorplay.distributed.rpc.init_rpc) ### init_rpc function[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.init_rpc.html) ```python tensorplay.distributed.rpc.init_rpc(name: str, backend: Any = BackendType.TENSORPIPE, rank: int = -1, world_size: int = -1, rpc_backend_options: Any = None) → None ``` [#](#api-tensorplay.distributed.rpc.is_available) ### is_available function[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.is_available.html) ```python tensorplay.distributed.rpc.is_available() → bool ``` [#](#api-tensorplay.distributed.rpc.method_factory) ### method_factory function[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.method_factory.html) ```python tensorplay.distributed.rpc.method_factory(method_name: str, docstring: str | None = None) ``` [#](#api-tensorplay.distributed.rpc.new_method) ### new_method function[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.new_method.html) ```python tensorplay.distributed.rpc.new_method(method_name: str, docstring: str | None = None) ``` [#](#api-tensorplay.distributed.rpc.register_backend) ### register_backend function[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.register_backend.html) ```python tensorplay.distributed.rpc.register_backend(backend_name: str, construct_rpc_backend_options_handler: Any, init_backend_handler: Any) → Enum ``` [#](#api-tensorplay.distributed.rpc.remote) ### remote function[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.remote.html) ```python tensorplay.distributed.rpc.remote(to: Any, func: Any, args: tuple[Any, ...] | None = None, kwargs: dict[str, Any] | None = None, timeout: float = -1.0) → RRef[Any] ``` [#](#api-tensorplay.distributed.rpc.rpc_async) ### rpc_async function[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.rpc_async.html) ```python tensorplay.distributed.rpc.rpc_async(to: Any, func: Any, args: tuple[Any, ...] | None = None, kwargs: dict[str, Any] | None = None, timeout: float = -1.0) → _Future[Any] ``` [#](#api-tensorplay.distributed.rpc.rpc_sync) ### rpc_sync function[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.rpc_sync.html) ```python tensorplay.distributed.rpc.rpc_sync(to: Any, func: Any, args: tuple[Any, ...] | None = None, kwargs: dict[str, Any] | None = None, timeout: float = -1.0) → Any ``` [#](#api-tensorplay.distributed.rpc.shutdown) ### shutdown function[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.shutdown.html) ```python tensorplay.distributed.rpc.shutdown(graceful: bool = True, timeout: float = 0.0) → None ``` ## Classes 5 [#](#api-tensorplay.distributed.rpc.AllGatherStates) ### AllGatherStates class[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.AllGatherStates.html) ```python class tensorplay.distributed.rpc.AllGatherStates ``` [#](#api-tensorplay.distributed.rpc.BackendType) ### BackendType class[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.BackendType.html) ```python class tensorplay.distributed.rpc.BackendType(*values) ``` [#](#api-tensorplay.distributed.rpc.BackendValue) ### BackendValue class[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.BackendValue.html) ```python class tensorplay.distributed.rpc.BackendValue(construct_rpc_backend_options_handler, init_backend_handler) ``` ```python construct_rpc_backend_options_handler ``` Alias for field number 0 ```python count(value, /) ``` Return number of occurrences of value. ```python index(value, start=0, stop=9223372036854775807, /) ``` Return first index of value. Raises ValueError if the value is not present. ```python init_backend_handler ``` Alias for field number 1 [#](#api-tensorplay.distributed.rpc.RRef) ### RRef class[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.RRef.html) ```python class tensorplay.distributed.rpc.RRef(value: T | object = , owner: Any = None, _future: _Future[T] | None = None, _native: Any = None) ``` [#](#api-tensorplay.distributed.rpc.TensorPipeRpcBackendOptions) ### TensorPipeRpcBackendOptions class[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.TensorPipeRpcBackendOptions.html) ```python class tensorplay.distributed.rpc.TensorPipeRpcBackendOptions(*, num_worker_threads: int = 16, rpc_timeout: float = 60.0, init_method: str = 'env://', device_maps: dict[str, dict[int | str | Any, int | str | Any]] | None = None, devices: list[int | str | Any] | None = None, _transports: list[Any] | None = None, _channels: list[Any] | None = None) ``` ## Attributes 1 [#](#api-tensorplay.distributed.rpc.Future) ### Future attribute[Full reference ↗](/docs/generated/tensorplay.distributed.rpc.Future.html) ```python tensorplay.distributed.rpc.Future ``` alias of _Future