Skip to content

Commit 2780068

Browse files
Manju Karthik Shivashankarfacebook-github-bot
authored andcommitted
Test old Lowering flow for op_ceiling.py (#7271)
Summary: - Added code to ensure that the legacy code was being called the same way as seen in linear.py Reviewed By: mcr229 Differential Revision: D66739374
1 parent c5848b2 commit 2780068

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

backends/xnnpack/test/ops/ceil.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,22 @@ def forward(self, x):
2020
return z
2121

2222
def _test_ceil(self, inputs):
23-
(
24-
Tester(self.Ceil(), inputs)
25-
.export()
26-
.check_count({"torch.ops.aten.ceil.default": 1})
27-
.to_edge_transform_and_lower()
28-
.check_count({"torch.ops.higher_order.executorch_call_delegate": 1})
29-
.check_not(["executorch_exir_dialects_edge__ops_aten_ceil_default"])
30-
.to_executorch()
31-
.serialize()
32-
.run_method_and_compare_outputs()
33-
)
23+
for legacy_mode in (True, False):
24+
tester = Tester(self.Ceil(), inputs)
25+
tester.export()
26+
tester.check_count({"torch.ops.aten.ceil.default": 1})
27+
28+
if legacy_mode:
29+
tester.to_edge()
30+
tester.partition()
31+
else:
32+
tester.to_edge_transform_and_lower()
33+
34+
tester.check_count({"torch.ops.higher_order.executorch_call_delegate": 1})
35+
tester.check_not(["executorch_exir_dialects_edge__ops_aten_ceil_default"])
36+
tester.to_executorch()
37+
tester.serialize()
38+
tester.run_method_and_compare_outputs()
3439

3540
def test_fp16_ceil(self):
3641
inputs = (

0 commit comments

Comments
 (0)