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

Raise an error when numpy.reshape don't return the good shape.

上级 e4099b80
...@@ -5876,6 +5876,8 @@ class Reshape(Op): ...@@ -5876,6 +5876,8 @@ class Reshape(Op):
except Exception: except Exception:
raise ValueError('Cannot reshape input of shape %s to shape %s' % raise ValueError('Cannot reshape input of shape %s to shape %s' %
(x.shape, shp)) (x.shape, shp))
if not out[0].flags.aligned:
raise RuntimeError("numpy.reshape returned a not aligned tensor.")
def connection_pattern(self, node): def connection_pattern(self, node):
return [[True], [False]] return [[True], [False]]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论