Mypy error with reproducible code

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?

Hi,

We are currently working on having a mypy compatible code base. Could you open an issue on github for this please?