pytorch

Форк
0
/
mypy.ini 
299 строк · 5.9 Кб
1
# This is the PyTorch mypy.ini file (note: don't change this line! -
2
# test_run_mypy in test/test_type_hints.py uses this string)
3

4
[mypy]
5
plugins = mypy_plugins/check_mypy_version.py, mypy_plugins/sympy_mypy_plugin.py, numpy.typing.mypy_plugin
6

7
cache_dir = .mypy_cache/normal
8
allow_redefinition = True
9
warn_unused_configs = True
10
warn_redundant_casts = True
11
show_error_codes = True
12
show_column_numbers = True
13
check_untyped_defs = True
14
follow_imports = normal
15
local_partial_types = True
16
enable_error_code = possibly-undefined
17

18
# do not reenable this:
19
# https://github.com/pytorch/pytorch/pull/60006#issuecomment-866130657
20
warn_unused_ignores = False
21

22
#
23
# Note: test/ still has syntax errors so can't be added
24
#
25
# Typing tests is low priority, but enabling type checking on the
26
# untyped test functions (using `--check-untyped-defs`) is still
27
# high-value because it helps test the typing.
28
#
29

30
files =
31
    torch,
32
    caffe2,
33
    test/test_bundled_images.py,
34
    test/test_bundled_inputs.py,
35
    test/test_complex.py,
36
    test/test_datapipe.py,
37
    test/test_futures.py,
38
    test/test_numpy_interop.py,
39
    test/test_torch.py,
40
    test/test_type_hints.py,
41
    test/test_type_info.py
42
    test/test_utils.py
43

44
#
45
# `exclude` is a regex, not a list of paths like `files` (sigh)
46
#
47
exclude = torch/include/|torch/csrc/|torch/distributed/elastic/agent/server/api.py|torch/testing/_internal|torch/distributed/fsdp/fully_sharded_data_parallel.py
48

49
python_version = 3.11
50

51

52
#
53
# Extension modules without stubs.
54
#
55

56
[mypy-torch._C._jit_tree_views]
57
ignore_missing_imports = True
58

59
[mypy-torch.for_onnx.onnx]
60
ignore_missing_imports = True
61

62
[mypy-torch.ao.quantization.experimental.apot_utils]
63
ignore_missing_imports = True
64

65
[mypy-torch.ao.quantization.experimental.quantizer]
66
ignore_missing_imports = True
67

68
[mypy-torch.ao.quantization.experimental.observer]
69
ignore_missing_imports = True
70

71
[mypy-torch.ao.quantization.experimental.APoT_tensor]
72
ignore_missing_imports = True
73

74
[mypy-torch.ao.quantization.experimental.fake_quantize_function]
75
ignore_missing_imports = True
76

77
[mypy-torch.ao.quantization.experimental.fake_quantize]
78
ignore_missing_imports = True
79

80
#
81
# Files with various errors. Mostly real errors, possibly some false
82
# positives as well.
83
#
84

85
[mypy-test_torch]
86
check_untyped_defs = False
87

88
# Excluded from mypy due to OpInfos being annoying to type
89
[mypy-torch.testing._internal.common_methods_invocations.*]
90
ignore_errors = True
91

92
[mypy-torch.testing._internal.hypothesis_utils.*]
93
ignore_errors = True
94

95
[mypy-torch.testing._internal.common_quantization.*]
96
ignore_errors = True
97

98
[mypy-torch.testing._internal.generated.*]
99
ignore_errors = True
100

101
[mypy-torch.testing._internal.distributed.*]
102
ignore_errors = True
103

104
[mypy-torch.nn.modules.pooling]
105
ignore_errors = True
106

107
[mypy-torch.nn.parallel._functions]
108
ignore_errors = True
109

110
[mypy-torch._appdirs]
111
ignore_errors = True
112

113
[mypy-torch.multiprocessing.pool]
114
ignore_errors = True
115

116
[mypy-torch.overrides]
117
ignore_errors = True
118

119
#
120
# Files with 'type: ignore' comments that are needed if checked with mypy-strict.ini
121
#
122

123
[mypy-tools.render_junit]
124
warn_unused_ignores = False
125

126
[mypy-tools.generate_torch_version]
127
warn_unused_ignores = False
128

129
#
130
# Adding type annotations to caffe2 is probably not worth the effort
131
# only work on this if you have a specific reason for it, otherwise
132
# leave these ignores as they are.
133
#
134

135
[mypy-caffe2.python.*]
136
ignore_errors = True
137

138
[mypy-caffe2.proto.*]
139
ignore_errors = True
140

141
[mypy-caffe2.core.nomnigraph.op_gen]
142
ignore_errors = True
143

144
[mypy-caffe2.distributed.store_ops_test_util]
145
ignore_errors = True
146

147
[mypy-caffe2.experiments.*]
148
ignore_errors = True
149

150
[mypy-caffe2.contrib.*]
151
ignore_errors = True
152

153
[mypy-caffe2.quantization.server.*]
154
ignore_errors = True
155

156
#
157
# Third party dependencies that don't have types.
158
#
159

160
[mypy-triton.*]
161
ignore_missing_imports = True
162

163
[mypy-tensorflow.*]
164
ignore_missing_imports = True
165

166
[mypy-tensorboard.*]
167
ignore_missing_imports = True
168

169
[mypy-onnx.*]
170
ignore_missing_imports = True
171

172
[mypy-matplotlib.*]
173
ignore_missing_imports = True
174

175
[mypy-numpy.*]
176
ignore_missing_imports = True
177

178
[mypy-sympy]
179
ignore_missing_imports = True
180

181
[mypy-sympy.*]
182
ignore_missing_imports = True
183

184
[mypy-hypothesis.*]
185
ignore_missing_imports = True
186

187
[mypy-tqdm.*]
188
ignore_missing_imports = True
189

190
[mypy-multiprocessing.*]
191
ignore_missing_imports = True
192

193
[mypy-setuptools.*]
194
ignore_missing_imports = True
195

196
[mypy-distutils.*]
197
ignore_missing_imports = True
198

199
[mypy-nvd3.*]
200
ignore_missing_imports = True
201

202
[mypy-future.utils]
203
ignore_missing_imports = True
204

205
[mypy-past.builtins]
206
ignore_missing_imports = True
207

208
[mypy-numba.*]
209
ignore_missing_imports = True
210

211
[mypy-PIL.*]
212
ignore_missing_imports = True
213

214
[mypy-moviepy.*]
215
ignore_missing_imports = True
216

217
[mypy-cv2.*]
218
ignore_missing_imports = True
219

220
[mypy-torchvision.*]
221
ignore_missing_imports = True
222

223
[mypy-pycuda.*]
224
ignore_missing_imports = True
225

226
[mypy-tensorrt.*]
227
ignore_missing_imports = True
228

229
[mypy-tornado.*]
230
ignore_missing_imports = True
231

232
[mypy-pydot.*]
233
ignore_missing_imports = True
234

235
[mypy-networkx.*]
236
ignore_missing_imports = True
237

238
[mypy-scipy.*]
239
ignore_missing_imports = True
240

241
[mypy-IPython.*]
242
ignore_missing_imports = True
243

244
[mypy-google.protobuf.textformat]
245
ignore_missing_imports = True
246

247
[mypy-lmdb.*]
248
ignore_missing_imports = True
249

250
[mypy-mpi4py.*]
251
ignore_missing_imports = True
252

253
[mypy-skimage.*]
254
ignore_missing_imports = True
255

256
[mypy-librosa.*]
257
ignore_missing_imports = True
258

259
[mypy-mypy.*]
260
ignore_missing_imports = True
261

262
[mypy-xml.*]
263
ignore_missing_imports = True
264

265
[mypy-boto3.*]
266
ignore_missing_imports = True
267

268
[mypy-dill.*]
269
ignore_missing_imports = True
270

271
[mypy-usort.*]
272
ignore_missing_imports = True
273

274
[mypy-torch._inductor.*]
275
disallow_any_generics = True
276

277
[mypy-torch._dynamo.*]
278
disallow_any_generics = True
279

280
[mypy-cutlass_library.*]
281
ignore_missing_imports = True
282

283
[mypy-deeplearning.*]
284
ignore_missing_imports = True
285

286
[mypy-einops.*]
287
ignore_missing_imports = True
288

289
[mypy-libfb.*]
290
ignore_missing_imports = True
291

292
[mypy-torch.*.fb.*]
293
ignore_missing_imports = True
294

295
[mypy-torch.fb.*]
296
ignore_missing_imports = True
297

298
[mypy-torch_xla.*]
299
ignore_missing_imports = True
300

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.