提交 39da3f0c authored 作者: Frederic's avatar Frederic

Keep python bool as python bool. don't convert to numpy bool. This fix crashes.

上级 2928d02a
...@@ -3622,7 +3622,7 @@ class GpuAllocEmpty(GpuOp): ...@@ -3622,7 +3622,7 @@ class GpuAllocEmpty(GpuOp):
const_shp = tensor.get_scalar_constant_value(s) const_shp = tensor.get_scalar_constant_value(s)
except tensor.NotScalarConstantError: except tensor.NotScalarConstantError:
const_shp = None const_shp = None
bcast.append(numpy.all(1 == const_shp)) bcast.append(1 == const_shp)
otype = CudaNdarrayType(dtype='float32', broadcastable=bcast) otype = CudaNdarrayType(dtype='float32', broadcastable=bcast)
output = otype() output = otype()
return sh, output return sh, output
......
...@@ -2673,7 +2673,7 @@ class Alloc(gof.Op): ...@@ -2673,7 +2673,7 @@ class Alloc(gof.Op):
const_shp = get_scalar_constant_value(s) const_shp = get_scalar_constant_value(s)
except NotScalarConstantError: except NotScalarConstantError:
const_shp = None const_shp = None
bcast.append(numpy.all(1 == const_shp)) bcast.append(1 == const_shp)
return sh, bcast return sh, bcast
def make_node(self, value, *shape): def make_node(self, value, *shape):
...@@ -6037,7 +6037,7 @@ class AllocEmpty(gof.Op): ...@@ -6037,7 +6037,7 @@ class AllocEmpty(gof.Op):
const_shp = get_scalar_constant_value(s) const_shp = get_scalar_constant_value(s)
except NotScalarConstantError: except NotScalarConstantError:
const_shp = None const_shp = None
bcast.append(numpy.all(1 == const_shp)) bcast.append(1 == const_shp)
otype = TensorType(dtype=self.dtype, broadcastable=bcast) otype = TensorType(dtype=self.dtype, broadcastable=bcast)
output = otype() output = otype()
return sh, output return sh, output
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论