提交 bae5b655 authored 作者: James Bergstra's avatar James Bergstra

small fallback hack in tensor.basic.Flatten to work with CudaNdarray

上级 4baa2b2b
......@@ -3103,7 +3103,10 @@ class Flatten(Op):
def perform(self, node, (x,), (out,)):
outdim = self.outdim
if outdim == 1:
out[0] = x.reshape(x.size)
try:
out[0] = x.reshape(x.size)
except AttributeError:
out[0] = x.reshape((numpy.prod(x.shape),))
elif outdim == len(x.shape):
out[0] = x
else:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论