提交 cd2f1dab authored 作者: Ian Goodfellow's avatar Ian Goodfellow 提交者: Frederic

added input index to error message

上级 3f597994
......@@ -966,8 +966,9 @@ def _populate_grad_dict(var_to_app_to_idx,
t_shape = term_v.shape
if i_shape != t_shape:
raise ValueError("%s.grad returned object of "
"shape %s as gradient term on input of "
"shape %s" % (node.op, t_shape, i_shape))
"shape %s as gradient term on input %d "
"of shape %s" % (node.op, t_shape, i,
i_shape))
if not isinstance(term.type,
(NullType, DisconnectedType)):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论