-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Closed
Labels
module: typingRelated to mypy type annotationsRelated to mypy type annotationstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
🐛 Bug
Some PyTorch functions implemented in both torch.Tensor.* and torch.* share same type hints.
However from the official document page, torch.* functions use keyword input as the first argument, but torch.Tensor.* uses self keyword.
To Reproduce
- Find any function which the first argument has keyword
selfinsite-packages/torch/__init__.pyi - Use keyword
inputinstead ofself - It works right in the console, but not in any Python type checker.
Expected behavior
Environment
PyTorch version: 1.5.0
Is debug build: No
CUDA used to build PyTorch: 10.1
OS: Ubuntu 18.04.4 LTS
GCC version: (Ubuntu 9.2.1-17ubuntu1~18.04.1) 9.2.1 20191102
CMake version: version 3.10.2
Python version: 3.8
Is CUDA available: Yes
CUDA runtime version: 10.0.130
GPU models and configuration: GPU 0: GeForce GTX 1080 Ti
Nvidia driver version: 430.50
cuDNN version: Could not collect
Versions of relevant libraries:
[pip] numpy==1.18.1
[pip] torch==1.5.0
[pip] torchfile==0.1.0
[pip] torchtext==0.5.0
[pip] torchvision==0.6.0a0+82fd1c8
[conda] blas 1.0 mkl
[conda] cudatoolkit 10.1.243 h6bb024c_0
[conda] mkl 2020.1 217
[conda] mkl-service 2.3.0 py38he904b0f_0
[conda] mkl_fft 1.0.15 py38ha843d7b_0
[conda] mkl_random 1.1.0 py38h962f231_0
[conda] numpy 1.18.1 py38h4f9e942_0
[conda] numpy-base 1.18.1 py38hde5b4d6_1
[conda] pytorch 1.5.0 py3.8_cuda10.1.243_cudnn7.6.3_0 pytorch
[conda] torchfile 0.1.0 pypi_0 pypi
[conda] torchtext 0.5.0 pypi_0 pypi
[conda] torchvision 0.6.0 py38_cu101 pytorch
[conda] mypy 0.770 py_0
[conda] mypy_extensions 0.4.3 py38_0
cc @ezyang
Metadata
Metadata
Assignees
Labels
module: typingRelated to mypy type annotationsRelated to mypy type annotationstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

