提交 8ab7da6f authored 作者: Frederic Bastien's avatar Frederic Bastien 提交者: Reyhane Askari

Make tests independant or toposort order

上级 ee8ca023
......@@ -212,7 +212,7 @@ class TestToposort:
o0 = MyOp.make_node(r1, r2)
o1 = MyOp.make_node(r3, r4)
all = io_toposort([r1, r2, r3, r4], o0.outputs + o1.outputs)
assert all == [o1, o0]
assert all == [o1, o0] or all == [o0, o1]
def test_4(self):
"""Test inputs and outputs mixed together in a chain graph"""
......
......@@ -1572,12 +1572,13 @@ class UsmmTests(unittest.TestCase):
# Usmm is tested at the same time in debugmode
# Check if the optimization local_usmm and local_usmm_csx is
# applied
assert isinstance(topo[0].op,
theano.sparse.basic.CSMProperties)
assert isinstance(topo[1].op, theano.tensor.DimShuffle)
assert isinstance(topo[2].op, theano.tensor.Subtensor)
assert topo[3].op == theano.tensor.neg
assert isinstance(topo[4].op, UsmmCscDense)
def check_once(x):
assert sum([isinstance(n.op, x) for n in topo]) == 1
check_once(theano.sparse.basic.CSMProperties)
check_once(theano.tensor.DimShuffle)
check_once(theano.tensor.Subtensor)
check_once(UsmmCscDense)
check_once(theano.tensor.Elemwise)
if inplace:
assert topo[4].op.inplace
elif not fast_compile:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论