提交 a00a6eec authored 作者: Reyhane Askari's avatar Reyhane Askari

moved theano.config.on_opt_error inside test_low_use_ratio

上级 58b91071
...@@ -572,8 +572,6 @@ class TestEquilibrium(object): ...@@ -572,8 +572,6 @@ class TestEquilibrium(object):
assert str(g) == '[Op2(x, y)]' assert str(g) == '[Op2(x, y)]'
def test_low_use_ratio(self): def test_low_use_ratio(self):
backup = theano.config.on_opt_error
theano.config.on_opt_error = 'warn'
x, y, z = map(MyVariable, 'xyz') x, y, z = map(MyVariable, 'xyz')
e = op3(op4(x, y)) e = op3(op4(x, y))
g = FunctionGraph([x, y, z], [e]) g = FunctionGraph([x, y, z], [e])
...@@ -583,6 +581,8 @@ class TestEquilibrium(object): ...@@ -583,6 +581,8 @@ class TestEquilibrium(object):
_logger = logging.getLogger('theano.gof.opt') _logger = logging.getLogger('theano.gof.opt')
oldlevel = _logger.level oldlevel = _logger.level
_logger.setLevel(logging.CRITICAL) _logger.setLevel(logging.CRITICAL)
backup = theano.config.on_opt_error
theano.config.on_opt_error = 'warn'
try: try:
opt = EquilibriumOptimizer( opt = EquilibriumOptimizer(
[PatternSub((op1, 'x', 'y'), (op2, 'x', 'y')), [PatternSub((op1, 'x', 'y'), (op2, 'x', 'y')),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论