提交 08ad8b0d authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Better check suggested in code review

上级 ea0717ee
......@@ -1773,11 +1773,13 @@ class Remove0Tester(utt.InferShapeTester):
if theano.config.mode not in ['FAST_COMPILE']:
# list of apply nodes in the optimized graph.
nodes = f.maker.fgraph.toposort()
for node in nodes:
if isinstance(node.op, Remove0):
assert node.op.inplace, ('Inplace optimization should '
'have been applied.')
# Check there isn't any Remove0 instance not inplace.
assert not any([isinstance(node.op, Remove0) and
not node.op.inplace for node in nodes]), (
'Inplace optimization should have been applied')
# Check there is at least one Remove0 inplace.
assert any([isinstance(node.op, Remove0) and node.op.inplace
for node in nodes])
# checking
# makes sense to change its name
target = mat
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论