Mypy error with reproducible code

When I use mypy with the following reproducible code

import torch
from torch.backends import cudnn

cudnn.deterministic = True
cudnn.benchmark = False

I get an error error: Module has no attribute "deterministic" 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?


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