提交 38edd48c authored 作者: Frederic Bastien's avatar Frederic Bastien

Print the stack trace when the input was created.

上级 1970fe04
......@@ -794,9 +794,16 @@ class Function(object):
function_name += ' with name "' + self.name + '"'
if hasattr(arg, 'name') and arg.name:
argument_name += ' with name "' + arg.name + '"'
e.args = ("Bad input " + argument_name + " to " +
function_name + " at index %d (0-based)"
% i,) + e.args
where = theano.gof.utils.get_variable_trace_string(
self.maker.inputs[i].variable)
if len(e.args) == 1:
e.args = ("Bad input " + argument_name + " to " +
function_name + " at index %d (0-based). %s"
% (i, where) + e.args[0],)
else:
e.args = ("Bad input " + argument_name + " to " +
function_name + " at index %d (0-based). %s"
% (i, where),) + e.args
raise
s.provided += 1
i += 1
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论