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

theano works on 32-bit architectures

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