diff --git a/test/quantization/pt2e/test_x86inductor_fusion.py b/test/quantization/pt2e/test_x86inductor_fusion.py index fdf217366d..ffaa4573d8 100644 --- a/test/quantization/pt2e/test_x86inductor_fusion.py +++ b/test/quantization/pt2e/test_x86inductor_fusion.py @@ -2307,10 +2307,13 @@ def matcher_check_fn(): nodes_count = 10 if has_bias else 7 else: nodes_count = 7 if has_bias else 6 - self.assertEqual( - counters["inductor"]["qlinear_weight_prepack_matcher_nodes"], - nodes_count, - ) + if counters["inductor"]["removed_pointless_view_pair"] == 0: + # Removing pointless view pairs affect how the pattern + # for this test is matched. + self.assertEqual( + counters["inductor"]["qlinear_weight_prepack_matcher_nodes"], + nodes_count, + ) self._test_common( mod,