pytorch
1# mypy: allow-untyped-defs
2from typing import Any3
4import torch5
6# This module is defined in torch/csrc/distributed/autograd/init.cpp
7
8class DistAutogradContext:9def _context_id(self) -> int: ...10def _recv_functions(self) -> dict[int, Any]: ...11def _send_functions(self) -> dict[int, Any]: ...12def _known_worker_ids(self) -> set[int]: ...13
14def _new_context() -> DistAutogradContext: ...15def _release_context(context_id: int) -> None: ...16def _get_max_id() -> int: ...17def _is_valid_context(worker_id: int) -> bool: ...18def _retrieve_context(context_id: int) -> DistAutogradContext: ...19def _current_context() -> DistAutogradContext: ...20def _init(worker_id: int) -> None: ...21def _get_debug_info() -> dict[str, str]: ...22def backward(23context_id: int,24roots: list[torch.Tensor],25retain_graph=False,26) -> None: ...27def get_gradients(context_id: int) -> dict[torch.Tensor, torch.Tensor]: ...28