Skip to content

Commit c2d97f2

Browse files
committed
remove post-inference decorator for backwards compatibility
1 parent 87afeb8 commit c2d97f2

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

src/kirin/dialects/vmath/rewrites/desugar.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from kirin.dialects.ilist import IListType
77

88
from ..stmts import add as vadd, div as vdiv, mul as vmul, sub as vsub
9-
from .._dialect import dialect
109

1110

1211
class DesugarBinOp(RewriteRule):
@@ -53,7 +52,6 @@ def replace_binop(self, node: ir.Statement) -> RewriteResult:
5352
return RewriteResult()
5453

5554

56-
@dialect.post_inference
5755
class WalkDesugarBinop(RewriteRule):
5856
"""
5957
Walks DesugarBinop. Needed for correct behavior when

test/dialects/vmath/test_desugar.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ def add_scalar_lhs():
2828
return add_kernel(x=3.0, y=[3.0, 4, 5])
2929

3030

31-
# def test_add_scalar_lhs():
32-
# # out = add_scalar_lhs()
33-
# VMathDesugar(add_scalar_lhs.dialects).unsafe_run(add_scalar_lhs)
34-
# add_scalar_lhs.print()
35-
# res = add_scalar_lhs()
36-
# assert isinstance(res, IList)
37-
# assert res.type.vars[0].typ is float
38-
# assert np.allclose(np.asarray(res), np.array([6, 7, 8]))
31+
def test_add_scalar_lhs():
32+
# out = add_scalar_lhs()
33+
VMathDesugar(add_scalar_lhs.dialects).unsafe_run(add_scalar_lhs)
34+
add_scalar_lhs.print()
35+
res = add_scalar_lhs()
36+
assert isinstance(res, IList)
37+
assert res.type.vars[0].typ is float
38+
assert np.allclose(np.asarray(res), np.array([6, 7, 8]))
3939

4040

4141
def test_typed_kernel_add():
42-
# VMathDesugar(add_scalar_rhs_typed.dialects).unsafe_run(add_scalar_rhs_typed)
42+
VMathDesugar(add_scalar_rhs_typed.dialects).unsafe_run(add_scalar_rhs_typed)
4343
add_scalar_rhs_typed.print()
4444
print(add_scalar_rhs_typed(IList([0, 1, 2]), 3.1))

0 commit comments

Comments
 (0)