提交 cced27f1 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Fix tests in FAST_COMPILE

上级 79b3c8c4
......@@ -1129,19 +1129,21 @@ def test_local_mul_specialize():
class T_Rebroadcast(unittest.TestCase):
def test_local_useless_rebroadcast(self):
mode = theano.compile.get_default_mode().including('canonicalize')
v1 = T.vector()
v2 = T.vector()
j = T.join(0, v1, v2)
f = theano.function([v1, v2], j)
f = theano.function([v1, v2], j, mode=mode)
f([1,2], [3,4,5])
e = f.maker.env.toposort()
assert len([n for n in e if isinstance(n.op, T.Rebroadcast)]) == 0
def test_rebroadcast_rebroadcast(self):
mode = theano.compile.get_default_mode().including('canonicalize')
m = T.matrix()
s = T.addbroadcast(m, 0, 1)
v = T.unbroadcast(s, 1)
f = theano.function([m], v)
f = theano.function([m], v, mode=mode)
f([[76]])
e = f.maker.env.toposort()
assert len([n for n in e if isinstance(n.op, T.Rebroadcast)]) == 1
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论