pytorch/torch/_C/_VariableFunctions.pyi.in
Ralf Gommers 649e683255 Fix torch.nonzero type annotation (#51635)
Summary:
The overloads are a little tricky here. It's important that the overloads are such that it's unambiguous what
`torch.nonzero(x)` will resolve to - so just specify defaults for one of the overloads. Also, `out` is left out of the second overload
because a non-None value for `out` is not valid in combination with `as_tuple=True`.

Closes gh-51434

Pull Request resolved: https://github.com/pytorch/pytorch/pull/51635

Reviewed By: zhangguanheng66

Differential Revision: D26279203

Pulled By: walterddr

fbshipit-source-id: 8459c04fc9fbf7fc5f31b3f631aaac2f98b17ea6
2021-02-08 08:45:44 -08:00

18 lines
490 B
Python

# ${generated_comment}
from torch import Tensor, Generator, strided, memory_format, contiguous_format, strided
from typing import List, Tuple, Optional, Union, Any, ContextManager, Callable, overload, Iterator, NamedTuple, Sequence, TypeVar
from typing_extensions import Literal
from torch._six import inf
from torch.types import _int, _float, _bool, Number, _dtype, _device, _qscheme, _size, _layout
import builtins
# REDUNDANT!
${namedtuple_defs}
${function_hints}
${all_directive}