提交 41d0d783 authored 作者: Frederic's avatar Frederic

Don't hide the real max recursion error in some cases.

上级 07c9fc7a
...@@ -308,7 +308,18 @@ class ReplaceValidate(History, Validator): ...@@ -308,7 +308,18 @@ class ReplaceValidate(History, Validator):
msg = str(e) msg = str(e)
s1 = 'The type of the replacement must be the same' s1 = 'The type of the replacement must be the same'
s2 = 'does not belong to this FunctionGraph' s2 = 'does not belong to this FunctionGraph'
if (s1 not in msg and s2 not in msg): s3 = 'maximum recursion depth exceeded'
if s3 in msg:
# There is nothing safe we can do to recover from this.
# So don't revert as this raise a different error
# that isn't helpful.
e.args += (
"Please, report this to theano-dev mailing list."
" As a temporary work around, you can raise Python"
" stack limit with:"
" import sys; sys.setrecursionlimit(10000)",)
raise
elif (s1 not in msg and s2 not in msg):
out = sys.stderr out = sys.stderr
print("<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>>", print("<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>>",
type(e), e, reason, file=out) type(e), e, reason, file=out)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论