提交 4aab58b4 authored 作者: Frederic Bastien's avatar Frederic Bastien

Use theano prod() to fix crash with more recent numpy

上级 61a1c69f
......@@ -1285,7 +1285,7 @@ def dnn_pool(img, ws, stride=(1, 1), mode='max', pad=(0, 0)):
if mode == "sum":
ret = GpuDnnPool(mode="average_inc_pad")(img, ws, stride, pad)
context_name = ret.type.context_name
window_elem = numpy.prod(ws).astype(ret.dtype)
window_elem = theano.tensor.prod(ws).astype(ret.dtype)
return as_gpuarray_variable(ret * window_elem, context_name)
return GpuDnnPool(mode=mode)(img, ws, stride, pad)
......
......@@ -2007,7 +2007,7 @@ def dnn_pool(img, ws, stride=(1, 1), mode='max', pad=(0, 0)):
img = gpu_contiguous(img)
if mode == "sum":
ret = GpuDnnPool(mode="average_inc_pad")(img, ws, stride, pad)
window_elem = numpy.prod(ws).astype(ret.dtype)
window_elem = theano.tensor.prod(ws).astype(ret.dtype)
return as_cuda_ndarray_variable(ret * window_elem)
return GpuDnnPool(mode=mode)(img, ws, stride, pad)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论