提交 5b044dc4 authored 作者: Frederic's avatar Frederic

small clean up

上级 edaab6c4
...@@ -101,7 +101,7 @@ def raise_with_op(node, thunk=None, exc_info=None, storage_map=None): ...@@ -101,7 +101,7 @@ def raise_with_op(node, thunk=None, exc_info=None, storage_map=None):
# print a simple traceback from KeyboardInterrupt # print a simple traceback from KeyboardInterrupt
raise exc_type, exc_value, exc_trace raise exc_type, exc_value, exc_trace
try: try:
trace = node.tag.trace trace = node.outputs[0].tag.trace
except AttributeError: except AttributeError:
try: try:
trace = node.op.tag.trace trace = node.op.tag.trace
...@@ -114,11 +114,6 @@ def raise_with_op(node, thunk=None, exc_info=None, storage_map=None): ...@@ -114,11 +114,6 @@ def raise_with_op(node, thunk=None, exc_info=None, storage_map=None):
else: else:
exc_value.__applynode_index__ = None exc_value.__applynode_index__ = None
# nose and unittest catch the exception and do not run th thunk_hook
# so it can be useful to just blurt out errors right here
if raise_with_op.print_thunk_trace:
log_thunk_trace(exc_value)
hints = [] hints = []
detailed_err_msg = "\nApply node that caused the error: " + str(node) detailed_err_msg = "\nApply node that caused the error: " + str(node)
...@@ -151,7 +146,7 @@ def raise_with_op(node, thunk=None, exc_info=None, storage_map=None): ...@@ -151,7 +146,7 @@ def raise_with_op(node, thunk=None, exc_info=None, storage_map=None):
" have the inputs shapes and strides printed.") " have the inputs shapes and strides printed.")
# Print node backtrace # Print node backtrace
tr = getattr(node.tag, 'trace', None) tr = getattr(node.outputs[0].tag, 'trace', None)
if tr: if tr:
sio = StringIO.StringIO() sio = StringIO.StringIO()
traceback.print_list(tr, sio) traceback.print_list(tr, sio)
...@@ -210,8 +205,6 @@ def raise_with_op(node, thunk=None, exc_info=None, storage_map=None): ...@@ -210,8 +205,6 @@ def raise_with_op(node, thunk=None, exc_info=None, storage_map=None):
'\n' + '\n'.join(hints)) '\n' + '\n'.join(hints))
raise exc_type, exc_value, exc_trace raise exc_type, exc_value, exc_trace
raise_with_op.print_thunk_trace = False
class Linker(object): class Linker(object):
"""WRITEME""" """WRITEME"""
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论