Skip to content

Commit 9eabb9c

Browse files
kaushikcfdinducer
authored andcommitted
Test pt.eliminate_dead_code
1 parent 4c76bd0 commit 9eabb9c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/test_pytato.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1998,6 +1998,14 @@ def test_pickling_hash():
19981998
# }}}
19991999

20002000

2001+
def test_eliminate_dead_code_removes_pt_zero():
2002+
x = pt.make_placeholder("x", (10, 4), np.float64)
2003+
expr1 = pt.tan(pt.zeros_like(x).T)
2004+
expr2 = pt.tan(pt.zeros(x.shape, x.dtype).T)
2005+
assert expr1 != expr2
2006+
assert pt.eliminate_dead_code(expr1) == expr2
2007+
2008+
20012009
if __name__ == "__main__":
20022010
import os
20032011
if "INVOCATION_INFO" in os.environ:

0 commit comments

Comments
 (0)