提交 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():
# 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))
# assert optimization is applied
# list of apply nodes in the optimized graph.
nodes = f.maker.env.toposort()
v = [True for node in nodes if isinstance(node.op, sp.Remove0) and node.op.inplace]
if theano.config.mode == 'FAST_RUN':
# assert optimization is applied in modes with optimization
if theano.config.mode not in ['FAST_COMPILE']:
# list of apply nodes in the optimized graph.
nodes = f.maker.env.toposort()
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.'
# checking
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论