File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -404,7 +404,14 @@ command = [
404
404
" --pattern=\\ bfrom torch\\ .ao\\ .quantization(?:\\ .[A-Za-z0-9_]+)*\\ b" ,
405
405
" --linter-name=TorchAOImport" ,
406
406
" --error-name=Prohibited torch.ao.quantization import" ,
407
- " --error-description=Imports from torch.ao.quantization are not allowed. Please import from torchao.quantization.pt2e instead." ,
407
+ """ --error-description=\
408
+ Imports from torch.ao.quantization are not allowed. \
409
+ Please import from torchao.quantization.pt2e instead.\n \
410
+ * torchao.quantization.pt2e (includes all the utils, including observers, fake quants etc.) \n \
411
+ * torchao.quantization.pt2e.quantizer (quantizer related objects and utils) \n \
412
+ * torchao.quantization.pt2e.quantize_pt2e (prepare_pt2e, prepare_qat_pt2e, convert_pt2e) \n\n \
413
+ If you need something from torch.ao.quantization, you can add your file to an exclude_patterns for TORCH_AO_IMPORT in .lintrunner.toml. \
414
+ """ ,
408
415
" --" ,
409
416
" @{{PATHSFILE}}" ,
410
417
]
Original file line number Diff line number Diff line change 11
11
from executorch .backends .example .example_operators .ops import module_to_annotator
12
12
from executorch .backends .xnnpack .quantizer .xnnpack_quantizer_utils import OperatorConfig
13
13
from torch import fx
14
- from torchao .quantization .pt2e import find_sequential_partitions
15
- from torchao .quantization .pt2e .observer import HistogramObserver , MinMaxObserver
14
+ from torchao .quantization .pt2e import (
15
+ find_sequential_partitions ,
16
+ HistogramObserver ,
17
+ MinMaxObserver ,
18
+ )
16
19
from torchao .quantization .pt2e .quantizer import QuantizationSpec , Quantizer
17
20
18
21
You can’t perform that action at this time.
0 commit comments