Skip to content

Commit

Permalink
Test old Lowering flow for op_ceiling.py (#7271)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Manju Karthik Shivashankar authored and facebook-github-bot committed Dec 10, 2024
1 parent c5848b2 commit 2780068
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions backends/xnnpack/test/ops/ceil.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,22 @@ def forward(self, x):
return z

def _test_ceil(self, inputs):
(
Tester(self.Ceil(), inputs)
.export()
.check_count({"torch.ops.aten.ceil.default": 1})
.to_edge_transform_and_lower()
.check_count({"torch.ops.higher_order.executorch_call_delegate": 1})
.check_not(["executorch_exir_dialects_edge__ops_aten_ceil_default"])
.to_executorch()
.serialize()
.run_method_and_compare_outputs()
)
for legacy_mode in (True, False):
tester = Tester(self.Ceil(), inputs)
tester.export()
tester.check_count({"torch.ops.aten.ceil.default": 1})

if legacy_mode:
tester.to_edge()
tester.partition()
else:
tester.to_edge_transform_and_lower()

tester.check_count({"torch.ops.higher_order.executorch_call_delegate": 1})
tester.check_not(["executorch_exir_dialects_edge__ops_aten_ceil_default"])
tester.to_executorch()
tester.serialize()
tester.run_method_and_compare_outputs()

def test_fp16_ceil(self):
inputs = (
Expand Down

0 comments on commit 2780068

Please sign in to comment.