提交 3474a426 authored 作者: Frederic's avatar Frederic

Give a better error message.

上级 a7f7719f
...@@ -963,6 +963,9 @@ class ShapeFeature(object): ...@@ -963,6 +963,9 @@ class ShapeFeature(object):
for sh_idx, sh in enumerate(o_shapes): for sh_idx, sh in enumerate(o_shapes):
if sh is None: if sh is None:
continue continue
if not isinstance(sh, (list, tuple)):
raise ValueError("infer_shape of %s didn't return a list of"
" list. It returned '%s'" % (str(node), str(o_shapes)))
for i, d in enumerate(sh): for i, d in enumerate(sh):
# Note: we ignore any shape element that is not typed (i.e., # Note: we ignore any shape element that is not typed (i.e.,
# does not have a 'dtype' attribute). This means there may # does not have a 'dtype' attribute). This means there may
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论