提交 12f0dac1 authored 作者: Frederic's avatar Frederic

Don't get in the try except above, by checking for the attribute manually and…

Don't get in the try except above, by checking for the attribute manually and doing the right thing.
上级 2fb96a72
...@@ -754,6 +754,9 @@ class ShapeFeature(object): ...@@ -754,6 +754,9 @@ class ShapeFeature(object):
def shape_tuple(self, r): def shape_tuple(self, r):
"""Return a tuple of symbolic shape vars for tensor variable r""" """Return a tuple of symbolic shape vars for tensor variable r"""
if not hasattr(r, 'ndim'):
# This happen for NoneConst.
return None
return tuple([self.shape_ir(i, r) for i in xrange(r.ndim)]) return tuple([self.shape_ir(i, r) for i in xrange(r.ndim)])
def default_infer_shape(self, node, i_shapes): def default_infer_shape(self, node, i_shapes):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论