提交 52d0ccb5 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Fix crash when error on inputs.

上级 604709ed
...@@ -255,10 +255,10 @@ class NanGuardMode(Mode): ...@@ -255,10 +255,10 @@ class NanGuardMode(Mode):
print("NanGuardMode found an error in the " print("NanGuardMode found an error in the "
"output of a node in this variable:", file=sio) "output of a node in this variable:", file=sio)
print(theano.printing.debugprint(nd, file='str'), file=sio) print(theano.printing.debugprint(nd, file='str'), file=sio)
msg = sio.getvalue()
else: else:
print("NanGuardMode found an error in an input of the " print("NanGuardMode found an error in an input of the "
"graph.", file=sio) "graph.", file=sio)
msg = sio.getvalue()
if config.NanGuardMode.action == 'raise': if config.NanGuardMode.action == 'raise':
raise AssertionError(msg) raise AssertionError(msg)
elif config.NanGuardMode.action == 'pdb': elif config.NanGuardMode.action == 'pdb':
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论