提交 d0e63566 authored 作者: Frederic's avatar Frederic

Better error message.

上级 4307602b
...@@ -1075,10 +1075,12 @@ class ShapeFeature(object): ...@@ -1075,10 +1075,12 @@ class ShapeFeature(object):
# an element of o_shapes is either None or a tuple # an element of o_shapes is either None or a tuple
# elements of the tuple can be either strings, or ints # elements of the tuple can be either strings, or ints
if len(o_shapes) != len(node.outputs): if len(o_shapes) != len(node.outputs):
raise Exception('len(o_shapes) = ' raise Exception(
+ str(len(o_shapes)) 'The infer_shape method for the Op "%s" returned a list ' +
+ ' != len(node.outputs) = ' 'with the wrong number of element: len(o_shapes) = %d ' +
+ str(len(node.outputs))) ' != len(node.outputs) = %d' % (str(node.op),
len(o_shapes),
len(node.outputs)))
# Ensure shapes are in 'int64'. This is to make sure the assert # Ensure shapes are in 'int64'. This is to make sure the assert
# found in the `local_useless_subtensor` optimization does not fail. # found in the `local_useless_subtensor` optimization does not fail.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论