Skip to content

Commit 909cfcb

Browse files
committed
up
1 parent ee7d9a1 commit 909cfcb

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.lintrunner.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,14 @@ command = [
404404
"--pattern=\\bfrom torch\\.ao\\.quantization(?:\\.[A-Za-z0-9_]+)*\\b",
405405
"--linter-name=TorchAOImport",
406406
"--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+
""",
408415
"--",
409416
"@{{PATHSFILE}}",
410417
]

backends/example/example_quantizer.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@
1111
from executorch.backends.example.example_operators.ops import module_to_annotator
1212
from executorch.backends.xnnpack.quantizer.xnnpack_quantizer_utils import OperatorConfig
1313
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+
)
1619
from torchao.quantization.pt2e.quantizer import QuantizationSpec, Quantizer
1720

1821

0 commit comments

Comments
 (0)