提交 0c37151c authored 作者: Frederic Bastien's avatar Frederic Bastien

now traceback.limit==-1 mean all and print info about it where appropriate.

上级 0ffd2fba
......@@ -70,5 +70,5 @@ AddConfigVar('cmodule.mac_framework_link',
BoolParam(False))
AddConfigVar('traceback.limit',
"The number of stack to trace. 0 mean all.",
IntParam(0))
"The number of stack to trace. -1 mean all.",
IntParam(-1))
......@@ -28,6 +28,7 @@ def thunk_hook(type, value, trace):
print>>sys.stderr, "Definition in: "
for line in traceback.format_list(trace2):
print>>sys.stderr, line,
print>>sys.stderr, "For the full definition stack trace set the Theano flags traceback.limit to -1"
__excepthook(type, value, trace)
sys.excepthook = thunk_hook
......
......@@ -321,7 +321,7 @@ class PureOp(object):
"""
node = self.make_node(*inputs, **kwargs)
limit = config.traceback.limit
if limit == 0: limit = None
if limit == -1: limit = None
node.tag.trace = traceback.extract_stack(limit=limit)[:-1]
if self.default_output is not None:
return node.outputs[self.default_output]
......
......@@ -246,7 +246,7 @@ class PureType(object):
"""
r = self.make_variable(name)
limit = config.traceback.limit
if limit == 0: limit = None
if limit == -1: limit = None
r.tag.trace = traceback.extract_stack(limit=limit)[:-1]
return r
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论