提交 11cdc43d authored 作者: Joseph Turian's avatar Joseph Turian

theano works on 32-bit architectures

上级 393818ca
......@@ -713,7 +713,7 @@ class Shape(Op):
x = as_tensor(x)
return Apply(self, [x], [lvector()])
def perform(self, node, (x, ), (out, )):
out[0] = numpy.asarray(x.shape)
out[0] = numpy.asarray(x.shape, dtype = 'int64')
def grad(self, (x,), (gz,)):
return [None]
@_redefine_asRoutine(Shape())
......
......@@ -55,8 +55,9 @@ class RandomFunction(gof.Op):
r = copy(r)
rout[0] = r
rval = self.fn(r, *(args + [shape]))
if not isinstance(rval, numpy.ndarray):
out[0] = numpy.asarray(rval, dtype = node.outputs[0].type.dtype)
if not isinstance(rval, numpy.ndarray) \
or str(rval.dtype) != node.outputs[1].type.dtype:
out[0] = numpy.asarray(rval, dtype = node.outputs[1].type.dtype)
else:
out[0] = rval
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论