提交 5dc75c1b authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix crash when Theano isn't completly imported

上级 4503f966
...@@ -471,7 +471,9 @@ def filter_mode(val): ...@@ -471,7 +471,9 @@ def filter_mode(val):
'NanGuardMode', 'NanGuardMode',
'FAST_COMPILE', 'DEBUG_MODE']: 'FAST_COMPILE', 'DEBUG_MODE']:
return val return val
elif isinstance(val, theano.Mode): # This can be executed before Theano is completly imported, so
# theano.Mode is not always available.
elif hasattr(theano, 'Mode') and isinstance(val, theano.Mode):
return val return val
else: else:
raise ValueError("Expected one of those string 'Mode', 'DebugMode'," raise ValueError("Expected one of those string 'Mode', 'DebugMode',"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论