__init__.pyi 967 Bytes
Newer Older
Tom Birch's avatar
Tom Birch committed
1
2
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.

3
from typing import Union, Callable, Optional, Any
4
from torch.futures import Future
Tom Birch's avatar
Tom Birch committed
5

6
7
class RRef: ...
class WorkerInfo: ...
Tom Birch's avatar
Tom Birch committed
8

9
10
11
12
class BackendType:
    TENSORPIPE: Any
    PROCESS_GROUP: Any

13
14
def TensorPipeRpcBackendOptions(init_method: str) -> Any: ...
def ProcessGroupRpcBackendOptions(init_method: str) -> Any: ...
Tom Birch's avatar
Tom Birch committed
15
16
17
18
19
20
def rpc_async(
    to: Union[str, WorkerInfo],
    func: Callable,
    args: Optional[tuple] = None,
    kwargs: Optional[dict] = None,
    timeout=-1.0,
21
) -> Future: ...
Tom Birch's avatar
Tom Birch committed
22
23
24
25
26
27
def rpc_sync(
    to: Union[str, WorkerInfo],
    func: Callable,
    args: Optional[tuple] = None,
    kwargs: Optional[dict] = None,
    timeout=-1.0,
28
29
30
31
32
33
34
35
36
) -> None: ...
def init_rpc(
    name: str,
    backend: Optional[Any] = None,
    rank: int = -1,
    world_size: Optional[int] = None,
    rpc_backend_options: Optional[Any] = None,
) -> None: ...
def shutdown(graceful: Optional[bool] = True) -> None: ...