🐛 Bug
When I use mypy with the following reproducible code
import torch
from torch.backends import cudnn
torch.manual_seed(0)
cudnn.deterministic = True
cudnn.benchmark = False
I get an error:
test.py:5: error: Module has no attribute "deterministic"
test.py:6: error: Module has no attribute "benchmark"
Found 2 errors in 1 file (checked 1 source file)
I think the problem arises from the fact that deterministic and benchmark are not defined in torch.backends.cudnn.__init__. Is there a workaround for this error (which is making my CI fail)?
To Reproduce
Steps to reproduce the behavior:
- Use
mypy with the above code snippet.
Expected behavior
I expect mypy to return no errors.
Environment
PyTorch version: 1.4.0
Is debug build: No
CUDA used to build PyTorch: 10.1
OS: Ubuntu 18.04.4 LTS
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
CMake version: version 3.10.2
Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: Could not collect
GPU models and configuration: GPU 0: GeForce GTX 1080 Ti
Nvidia driver version: 440.64
cuDNN version: Could not collect
Additional context
X-posted from the the PyTorch Forums: Mypy error with reproducible code. @albanD
cc @ezyang
🐛 Bug
When I use
mypywith the following reproducible codeI get an error:
I think the problem arises from the fact that
deterministicandbenchmarkare not defined intorch.backends.cudnn.__init__. Is there a workaround for this error (which is making my CI fail)?To Reproduce
Steps to reproduce the behavior:
mypywith the above code snippet.Expected behavior
I expect
mypyto return no errors.Environment
Additional context
X-posted from the the PyTorch Forums: Mypy error with reproducible code. @albanD
cc @ezyang