提交 1615f991 authored 作者: Brandon T. Willard's avatar Brandon T. Willard 提交者: Brandon T. Willard

Remove unnecessary assumptions from TestAlgebraicCanonizer.test_multiple_case

上级 8559ae44
...@@ -513,7 +513,6 @@ class TestAlgebraicCanonizer: ...@@ -513,7 +513,6 @@ class TestAlgebraicCanonizer:
assert len(f.maker.fgraph.toposort()) == nb_elemwise assert len(f.maker.fgraph.toposort()) == nb_elemwise
assert out_dtype == out.dtype assert out_dtype == out.dtype
@pytest.mark.slow
def test_multiple_case(self): def test_multiple_case(self):
# test those case take from the comment in AlgebraicCanonizer # test those case take from the comment in AlgebraicCanonizer
# x / x -> 1 # x / x -> 1
...@@ -594,10 +593,7 @@ class TestAlgebraicCanonizer: ...@@ -594,10 +593,7 @@ class TestAlgebraicCanonizer:
assert out_dtype == out.dtype assert out_dtype == out.dtype
utt.assert_allclose(out, val_inputs[1]) utt.assert_allclose(out, val_inputs[1])
topo = f.maker.fgraph.toposort() topo = f.maker.fgraph.toposort()
if topo and not (len(topo) == 1 and topo[0].op == deep_copy_op): assert not any(node.op == at.true_div for node in topo)
for node in topo[:-1]:
assert isinstance(node.op, Shape_i)
assert isinstance(topo[-1].op, Alloc)
# test x / y / x -> 1 / y # test x / y / x -> 1 / y
for id, (g, sym_inputs, val_inputs, nb_elemwise, out_dtype) in enumerate( for id, (g, sym_inputs, val_inputs, nb_elemwise, out_dtype) in enumerate(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论