提交 5d6cc6df authored 作者: Ian Goodfellow's avatar Ian Goodfellow

added a verbose exception

上级 7cb2384c
...@@ -5303,6 +5303,12 @@ class Dot(Op): ...@@ -5303,6 +5303,12 @@ class Dot(Op):
z[0] = numpy.asarray(numpy.dot(x, y)) z[0] = numpy.asarray(numpy.dot(x, y))
except ValueError, e: except ValueError, e:
# The error raised by numpy has no shape information, we mean to add that # The error raised by numpy has no shape information, we mean to add that
if config.exception_verbosity == 'high':
raise ValueError('dot product failed.\n'
'First arg dims: '+str(x.shape)+'\n'
'Second arg dims: '+str(y.shape)+'\n'
'First arg: \n'+min_informative_str(node.inputs[0])+'\n'
'Second arg: \n'+min_informative_str(node.inputs[1]))
e.args = e.args + (x.shape, y.shape) e.args = e.args + (x.shape, y.shape)
raise raise
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论