mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
------ - [Generic TypeAlias (PEP 585)](https://peps.python.org/pep-0585): e.g. `typing.List[T] -> list[T]`, `typing.Dict[KT, VT] -> dict[KT, VT]`, `typing.Type[T] -> type[T]`. - [Union Type (PEP 604)](https://peps.python.org/pep-0604): e.g. `Union[X, Y] -> X | Y`, `Optional[X] -> X | None`, `Optional[Union[X, Y]] -> X | Y | None`. Note that in `.pyi` stub files, we do not need `from __future__ import annotations`. So this PR does not violate issue #117449: - #117449 Pull Request resolved: https://github.com/pytorch/pytorch/pull/129419 Approved by: https://github.com/ezyang ghstack dependencies: #129375, #129376
28 lines
971 B
Python
28 lines
971 B
Python
# mypy: allow-untyped-defs
|
|
from torch import Tensor
|
|
|
|
# defined in torch/csrc/lazy/python/init.cpp
|
|
def _mark_step(device: str, devices: list[str], wait: bool): ...
|
|
def _wait_device_ops(devices: list[str]): ...
|
|
def _reset_metrics(): ...
|
|
def _counter_names() -> list[str]: ...
|
|
def _counter_value(name: str) -> int: ...
|
|
def _metrics_report() -> str: ...
|
|
def _get_graph_hash(tensors: list[Tensor]) -> str: ...
|
|
def _sync_multi(
|
|
tensors: list[Tensor],
|
|
devices: list[str],
|
|
wait: bool = True,
|
|
sync_ltc_data: bool = True,
|
|
): ...
|
|
def _get_tensor_id(tensor: Tensor) -> int: ...
|
|
def _get_tensors_text(tensors: list[Tensor]) -> str: ...
|
|
def _get_tensors_dot(tensors: list[Tensor]) -> str: ...
|
|
def _get_tensors_backend(tensors: list[Tensor]) -> str: ...
|
|
def _get_force_fallback() -> str: ...
|
|
def _set_force_fallback(newval: str): ...
|
|
def _clear_ir_cache(): ...
|
|
def _dump_ir_cache(filename: str): ...
|
|
def _set_reuse_ir(val: bool): ...
|
|
def _get_default_device_type(): ...
|