Skip to content

Commit 4bad7fc

Browse files
Rong Rongxuzhao9
authored andcommitted
split torch.testing._internal.* and add type checking for torch.testing._internal.common_cuda (#44575)
Summary: First step to fix #42969. Pull Request resolved: #44575 Reviewed By: malfet Differential Revision: D23668740 Pulled By: walterddr fbshipit-source-id: eeb3650b1780aaa5727b525b4e6182e1bc47a83f
1 parent a70f46a commit 4bad7fc

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed

mypy.ini

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,55 @@ ignore_errors = True
5959
[mypy-torch.jit.*]
6060
ignore_errors = True
6161

62-
[mypy-torch.testing._internal.*]
62+
[mypy-torch.testing._internal.te_utils.*]
63+
ignore_errors = True
64+
65+
[mypy-torch.testing._internal.dist_utils.*]
66+
ignore_errors = True
67+
68+
[mypy-torch.testing._internal.codegen.*]
69+
ignore_errors = True
70+
71+
# [mypy-torch.testing._internal.common_cuda.*]
72+
# ignore_errors = True
73+
74+
[mypy-torch.testing._internal.common_quantized.*]
75+
ignore_errors = True
76+
77+
[mypy-torch.testing._internal.common_distributed.*]
78+
ignore_errors = True
79+
80+
[mypy-torch.testing._internal.jit_utils.*]
81+
ignore_errors = True
82+
83+
[mypy-torch.testing._internal.common_device_type.*]
84+
ignore_errors = True
85+
86+
[mypy-torch.testing._internal.autocast_test_lists.*]
87+
ignore_errors = True
88+
89+
[mypy-torch.testing._internal.hypothesis_utils.*]
90+
ignore_errors = True
91+
92+
[mypy-torch.testing._internal.common_methods_invocations.*]
93+
ignore_errors = True
94+
95+
[mypy-torch.testing._internal.jit_metaprogramming_utils.*]
96+
ignore_errors = True
97+
98+
[mypy-torch.testing._internal.common_nn.*]
99+
ignore_errors = True
100+
101+
[mypy-torch.testing._internal.common_quantization.*]
102+
ignore_errors = True
103+
104+
[mypy-torch.testing._internal.common_utils.*]
105+
ignore_errors = True
106+
107+
[mypy-torch.testing._internal.generated.*]
108+
ignore_errors = True
109+
110+
[mypy-torch.testing._internal.distributed.*]
63111
ignore_errors = True
64112

65113
[mypy-torch.quantization.observer]

torch/testing/_internal/common_cuda.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
TEST_CUDA = torch.cuda.is_available()
1212
TEST_MULTIGPU = TEST_CUDA and torch.cuda.device_count() >= 2
13-
CUDA_DEVICE = TEST_CUDA and torch.device("cuda:0")
13+
CUDA_DEVICE = torch.device("cuda:0") if TEST_CUDA else None
1414
# note: if ROCm is targeted, TEST_CUDNN is code for TEST_MIOPEN
1515
TEST_CUDNN = TEST_CUDA and torch.backends.cudnn.is_acceptable(torch.tensor(1., device=CUDA_DEVICE))
1616
TEST_CUDNN_VERSION = torch.backends.cudnn.version() if TEST_CUDNN else 0

0 commit comments

Comments
 (0)