提交 58b91071 authored 作者: Reyhane Askari's avatar Reyhane Askari

increased optdb.max_use_ratio to 8 and set on_opt_error to warn for test_low_use_ratio

上级 77a3c285
......@@ -1104,7 +1104,7 @@ AddConfigVar('optdb.position_cutoff',
AddConfigVar('optdb.max_use_ratio',
'A ratio that prevent infinite loop in EquilibriumOptimizer.',
FloatParam(6),
FloatParam(8),
in_c_key=False)
AddConfigVar('gcc.cxxflags',
......
......@@ -572,6 +572,8 @@ class TestEquilibrium(object):
assert str(g) == '[Op2(x, y)]'
def test_low_use_ratio(self):
backup = theano.config.on_opt_error
theano.config.on_opt_error = 'warn'
x, y, z = map(MyVariable, 'xyz')
e = op3(op4(x, y))
g = FunctionGraph([x, y, z], [e])
......@@ -590,6 +592,7 @@ class TestEquilibrium(object):
max_use_ratio=1. / len(g.apply_nodes)) # each opt can only be applied once
opt.optimize(g)
finally:
theano.config.on_opt_error = backup
_logger.setLevel(oldlevel)
# print 'after', g
assert str(g) == '[Op1(x, y)]'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论