mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 00:21:07 +01:00
Skipping importing some packages for now to make this change more tractable. For some reason, lintrunner on CI raises errors in all imported `.pyi` files, even though it doesn't on my local machine. The errors are all from missing generic types, as the MYPYINDUCTOR config has `disallow_any_generics` set. I have thus added `disable-error-code` comments to the relevant files, though I fixed a few that were easy enough. Pull Request resolved: https://github.com/pytorch/pytorch/pull/113830 Approved by: https://github.com/Skylion007 ghstack dependencies: #113722, #113721
42 lines
627 B
Python
42 lines
627 B
Python
# ${generated_comment}
|
|
# mypy: disable-error-code="type-arg"
|
|
|
|
import builtins
|
|
from typing import (
|
|
Any,
|
|
Callable,
|
|
ContextManager,
|
|
Iterator,
|
|
List,
|
|
Literal,
|
|
NamedTuple,
|
|
Optional,
|
|
overload,
|
|
Sequence,
|
|
Tuple,
|
|
TypeVar,
|
|
Union,
|
|
)
|
|
|
|
import torch
|
|
from torch import contiguous_format, Generator, inf, memory_format, strided, SymInt, Tensor
|
|
from torch.types import (
|
|
_bool,
|
|
_complex,
|
|
_device,
|
|
_dtype,
|
|
_float,
|
|
_int,
|
|
_layout,
|
|
_qscheme,
|
|
_size,
|
|
Device,
|
|
Number,
|
|
)
|
|
|
|
from torch._prims_common import DeviceLikeType
|
|
|
|
${function_hints}
|
|
|
|
${all_directive}
|