提交 589fc4b0 authored 作者: Cesar Laurent's avatar Cesar Laurent

Corrected boolean algebra.

上级 a99724e3
...@@ -331,7 +331,7 @@ class Pool(OpenMPOp): ...@@ -331,7 +331,7 @@ class Pool(OpenMPOp):
inc_pad = self.mode == 'average_inc_pad' inc_pad = self.mode == 'average_inc_pad'
# pad the image # pad the image
if pad_h != 0 and pad_w != 0: if (pad_h, pad_w) != (0, 0):
y = numpy.zeros( y = numpy.zeros(
(x.shape[0], x.shape[1], img_rows, img_cols), (x.shape[0], x.shape[1], img_rows, img_cols),
dtype=x.dtype) dtype=x.dtype)
...@@ -746,7 +746,7 @@ class MaxPoolGrad(PoolGrad): ...@@ -746,7 +746,7 @@ class MaxPoolGrad(PoolGrad):
img_cols = x.shape[-1] + 2 * pad_w img_cols = x.shape[-1] + 2 * pad_w
# pad the image # pad the image
if pad_h != 0 and pad_w != 0: if (pad_h, pad_w) != (0, 0):
y = numpy.zeros( y = numpy.zeros(
(x.shape[0], x.shape[1], img_rows, img_cols), (x.shape[0], x.shape[1], img_rows, img_cols),
dtype=x.dtype) dtype=x.dtype)
...@@ -952,7 +952,7 @@ class AveragePoolGrad(PoolGrad): ...@@ -952,7 +952,7 @@ class AveragePoolGrad(PoolGrad):
sum_mode = self.mode == 'sum' sum_mode = self.mode == 'sum'
# pad the image # pad the image
if pad_h != 0 and pad_w != 0: if (pad_h, pad_w) != (0, 0):
y = numpy.zeros( y = numpy.zeros(
(x.shape[0], x.shape[1], img_rows, img_cols), (x.shape[0], x.shape[1], img_rows, img_cols),
dtype=x.dtype) dtype=x.dtype)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论