提交 05be6c02 authored 作者: Caglar's avatar Caglar

Fixed the test for the stacktrace.

上级 f2c76070
......@@ -1635,8 +1635,8 @@ def test_log_add():
def test_local_useless_slice():
# test a simple matrix
x = tensor.matrix('x')
mode_unopt = compile.get_default_mode().excluding("local_useless_slice")
mode_opt = compile.get_default_mode().including("local_useless_slice")
mode_unopt = compile.get_default_mode().excluding("local_useless_slice", "local_mul_canonizer")
mode_opt = compile.get_default_mode().including("local_useless_slice").excluding("local_mul_canonizer")
# test with and without the useless slice
o = 2 * x[0, :]
......@@ -2124,7 +2124,7 @@ class test_local_subtensor_lift(unittest.TestCase):
f1 = function([x], newx[:2, :5], mode=mode_opt)
# Check stacktrace was copied over correctly after opt was applied
self.assertTrue(check_stack_trace(f1, ops_to_check=[
Subtensor, tensor.Rebroadcast]))
Subtensor, tensor.Rebroadcast]))
prog = f1.maker.fgraph.toposort()
assert isinstance(prog[0].op, tensor.Subtensor)
assert isinstance(prog[1].op, tensor.Rebroadcast)
......@@ -2140,7 +2140,7 @@ class test_local_subtensor_lift(unittest.TestCase):
f2 = function([y], newy[:, 3, 0, :], mode=mode_opt)
# Check stacktrace was copied over correctly after opt was applied
self.assertTrue(check_stack_trace(f2, ops_to_check=[
Subtensor, tensor.Rebroadcast]))
Subtensor, tensor.Rebroadcast]))
prog = f2.maker.fgraph.toposort()
assert isinstance(prog[0].op, tensor.Subtensor)
assert isinstance(prog[1].op, tensor.Rebroadcast)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论