提交 de4cbdff authored 作者: Frederic Bastien's avatar Frederic Bastien

check the toposort in the test for identity.

上级 5aac104a
...@@ -893,6 +893,11 @@ def test_identity(): ...@@ -893,6 +893,11 @@ def test_identity():
f = function([sym], tensor_copy(sym)) f = function([sym], tensor_copy(sym))
assert numpy.all(obj == f(obj)) assert numpy.all(obj == f(obj))
assert obj.dtype == f(obj).dtype assert obj.dtype == f(obj).dtype
topo = f.maker.env.toposort()
assert len(topo)==1
if theano.config.mode != 'FAST_COMPILE':
assert isinstance(topo[0].op, theano.compile.function_module.DeepCopyOp)
for dtype in ALL_DTYPES: for dtype in ALL_DTYPES:
yield check, dtype yield check, dtype
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论