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