Skip to content

Commit 3c7fe32

Browse files
committed
Refactor test and imports
1 parent 62e30e5 commit 3c7fe32

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

backends/xnnpack/_passes/channels_last_tagged_reshape_pass.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88

99
import torch
1010
from executorch.backends.xnnpack._passes.xnnpack_pass import XNNPACKPass
11-
from executorch.backends.xnnpack.utils.utils import is_param_node
1211
from executorch.backends.xnnpack.utils.quant_utils import is_dynamic_qdq
12+
from executorch.backends.xnnpack.utils.utils import is_param_node
1313
from executorch.exir.dialects._ops import ops as exir_ops
1414
from executorch.exir.pass_base import PassResult
1515

16+
1617
# TODO(T151254305) use subgraph_rewriter
1718
class ChannelsLastTaggedReshapePass(XNNPACKPass):
1819
"""

backends/xnnpack/test/ops/test_conv2d.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@
3030
)
3131
from executorch.backends.xnnpack.test.test_xnnpack_utils import randomize_bn
3232
from executorch.backends.xnnpack.test.tester import Quantize, Tester
33-
from executorch.backends.xnnpack.test.tester.tester import (
34-
Partition,
35-
ToEdgeTransformAndLower,
36-
)
33+
from executorch.backends.xnnpack.test.tester.tester import ToEdgeTransformAndLower
3734
from executorch.exir.dialects._ops import ops as exir_ops
3835

3936

@@ -176,7 +173,7 @@ def get_inputs(self):
176173
return (torch.randn(2, 2, 4, 4),)
177174

178175

179-
class DQConv2d(torch.nn.Module):
176+
class Conv2dDynamicQuant(torch.nn.Module):
180177
def __init__(self):
181178
super().__init__()
182179
self.conv = torch.nn.Conv2d(3, 10, 3)
@@ -750,8 +747,8 @@ def forward(self, x):
750747
.run_method_and_compare_outputs(qtol=1)
751748
)
752749

753-
def test_qs8_dq_conv2d(self) -> None:
754-
model = DQConv2d()
750+
def test_dq_conv2d(self) -> None:
751+
model = Conv2dDynamicQuant()
755752
self._test_dq(
756753
model,
757754
model.get_inputs(),

0 commit comments

Comments
 (0)