提交 fd294cc8 authored 作者: Valentin Bisson's avatar Valentin Bisson

CCW#37: modified theano.config.mode value under which assertion of application…

CCW#37: modified theano.config.mode value under which assertion of application of the optimization is done.
上级 2ec75f3e
...@@ -449,11 +449,11 @@ def test_remove0(): ...@@ -449,11 +449,11 @@ def test_remove0():
# the In thingy has to be there because theano has as rule not to optimize inputs # the In thingy has to be there because theano has as rule not to optimize inputs
f = theano.function([theano.In(x, borrow=True, mutable=True)], sp.Remove0()(x)) f = theano.function([theano.In(x, borrow=True, mutable=True)], sp.Remove0()(x))
# assert optimization is applied # assert optimization is applied in modes with optimization
# list of apply nodes in the optimized graph. if theano.config.mode not in ['FAST_COMPILE']:
nodes = f.maker.env.toposort() # list of apply nodes in the optimized graph.
v = [True for node in nodes if isinstance(node.op, sp.Remove0) and node.op.inplace] nodes = f.maker.env.toposort()
if theano.config.mode == 'FAST_RUN': v = [True for node in nodes if isinstance(node.op, sp.Remove0) and node.op.inplace]
assert len(v), 'Inplacing optimization should have been applied.' assert len(v), 'Inplacing optimization should have been applied.'
# checking # checking
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论