@@ -384,24 +384,18 @@ code = "TORCH_AO_IMPORT"
384
384
include_patterns = [" **/*.py" ]
385
385
exclude_patterns = [
386
386
" third-party/**" ,
387
- # Some existing files have imports from torch.ao.quantization that are not going away, e.g.,
388
- # from torch.ao.quantization.fx.utils, from torch.ao.quantization.qconfig, etc.
389
- " backends/xnnpack/test/test_xnnpack_utils.py" ,
390
- " exir/backend/test/demos/test_xnnpack_qnnpack.py" ,
391
- " backends/xnnpack/quantizer/xnnpack_quantizer_utils.py" ,
392
- " backends/xnnpack/test/quantizer/test_pt2e_quantization.py" ,
393
- " backends/xnnpack/test/quantizer/test_xnnpack_quantizer.py" ,
394
- " examples/xnnpack/quantization/example.py" ,
395
- " exir/tests/test_quantization.py" ,
396
- " exir/tests/test_memory_planning.py" ,
397
387
]
388
+
398
389
command = [
399
390
" python3" ,
400
391
" -m" ,
401
392
" lintrunner_adapters" ,
402
393
" run" ,
403
394
" grep_linter" ,
404
- " --pattern=\\ bfrom torch\\ .ao\\ .quantization(?:\\ .[A-Za-z0-9_]+)*\\ b" ,
395
+ " --pattern=\\ bfrom torch\\ .ao\\ .quantization\\ .quantizer(?:\\ .[A-Za-z0-9_]+)*\\ b" ,
396
+ " --pattern=\\ bfrom torch\\ .ao\\ .quantization\\ .observer(?:\\ .[A-Za-z0-9_]+)*\\ b" ,
397
+ " --pattern=\\ bfrom torch\\ .ao\\ .quantization\\ .quantize_pt2e(?:\\ .[A-Za-z0-9_]+)*\\ b" ,
398
+ " --pattern=\\ bfrom torch\\ .ao\\ .quantization\\ .pt2e(?:\\ .[A-Za-z0-9_]+)*\\ b" ,
405
399
" --linter-name=TorchAOImport" ,
406
400
" --error-name=Prohibited torch.ao.quantization import" ,
407
401
""" --error-description=\
0 commit comments