Skip to content

Commit 14f1713

Browse files
Fixed ruff CI failure
ruff- I001 standard intrgrated.
1 parent 2afd6af commit 14f1713

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed

test/quantization/pt2e/test_arminductor_quantizer.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,38 @@
1111
from enum import Enum
1212

1313
import torch
14-
import torchao.quantization.pt2e.quantizer.arm_inductor_quantizer as armiq
1514
import torch.nn as nn
15+
16+
import torchao.quantization.pt2e.quantizer.arm_inductor_quantizer as armiq
1617
from torchao.quantization.pt2e import ObserverBase
1718
from torchao.quantization.pt2e.quantize_pt2e import (
1819
convert_pt2e,
1920
prepare_pt2e,
2021
prepare_qat_pt2e,
2122
)
22-
from torchao.quantization.pt2e.quantizer.arm_inductor_quantizer import ArmInductorQuantizer
23-
from torchao.quantization.pt2e.quantizer.x86_inductor_quantizer import QUANT_ANNOTATION_KEY
23+
from torchao.quantization.pt2e.quantizer.arm_inductor_quantizer import (
24+
ArmInductorQuantizer,
25+
)
26+
from torchao.quantization.pt2e.quantizer.x86_inductor_quantizer import (
27+
QUANT_ANNOTATION_KEY,
28+
)
2429
from torchao.utils import TORCH_VERSION_AT_LEAST_2_5, TORCH_VERSION_AT_LEAST_2_7
2530

2631
if TORCH_VERSION_AT_LEAST_2_5:
2732
from torch.export import export_for_training
2833

34+
import functools
35+
import platform
36+
2937
from torch.testing._internal.common_quantization import (
3038
NodeSpec as ns,
39+
)
40+
from torch.testing._internal.common_quantization import (
3141
QuantizationTestCase,
3242
skipIfNoInductorSupport,
3343
)
3444
from torch.testing._internal.common_utils import run_tests, skipIfTorchDynamo
3545

36-
import functools
37-
import platform
3846

3947
def skipIfNoArm(fn):
4048
reason = 'Quantized operations require Arm.'

torchao/quantization/pt2e/quantizer/arm_inductor_quantizer.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
import operator
1010
import warnings
1111
from dataclasses import dataclass
12-
from typing import Any, Callable, Dict, List, Optional, TYPE_CHECKING
13-
from typing_extensions import TypeAlias
12+
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional
1413

1514
import torch
1615
import torch.nn.functional as F
16+
from torch.fx import Node
17+
from typing_extensions import TypeAlias
18+
1719
from torchao.quantization.pt2e.fake_quantize import (
1820
FakeQuantize,
1921
FusedMovingAvgObsFakeQuantize,
@@ -24,14 +26,19 @@
2426
MovingAverageMinMaxObserver,
2527
PlaceholderObserver,
2628
)
27-
from torchao.quantization.pt2e.quantizer.quantizer import QuantizationSpec, QuantizationAnnotation
28-
from torchao.quantization.pt2e.quantizer import QuantizationConfig, get_module_name_filter
29-
from torch.fx import Node
29+
from torchao.quantization.pt2e.quantizer import (
30+
QuantizationConfig,
31+
get_module_name_filter,
32+
)
33+
from torchao.quantization.pt2e.quantizer.quantizer import (
34+
QuantizationAnnotation,
35+
QuantizationSpec,
36+
)
37+
3038
from .x86_inductor_quantizer import (
3139
X86InductorQuantizer,
3240
)
3341

34-
3542
FilterFn: TypeAlias = Callable[[List[Node]], bool]
3643

3744

0 commit comments

Comments
 (0)