diff --git a/python/paddle/nn/functional/pooling.py b/python/paddle/nn/functional/pooling.py index 73e3cb31221f131cf5866177a96a3fcb46d8d189..40166f4d36e94ec74614e7c81c8c9b20f7c09a72 100755 --- a/python/paddle/nn/functional/pooling.py +++ b/python/paddle/nn/functional/pooling.py @@ -230,7 +230,7 @@ def avg_pool1d(x, x, 'pooling_type', 'avg', 'ksize', kernel_size, 'global_pooling', False, 'strides', stride, 'paddings', padding, 'padding_algorithm', padding_algorithm, 'use_cudnn', True, 'ceil_mode', ceil_mode, - 'use_mkldnn', False, 'exclusive', not exclusive, 'data_format', + 'use_mkldnn', False, 'exclusive', exclusive, 'data_format', data_format) return squeeze(output, [2]) @@ -338,7 +338,7 @@ def avg_pool2d(x, x, 'pooling_type', 'avg', 'ksize', kernel_size, 'global_pooling', False, 'padding_algorithm', padding_algorithm, 'strides', stride, 'paddings', padding, 'use_cudnn', True, 'ceil_mode', ceil_mode, - 'use_mkldnn', False, 'exclusive', not exclusive, 'data_format', + 'use_mkldnn', False, 'exclusive', exclusive, 'data_format', data_format) if divisor_override is None: return output @@ -452,7 +452,7 @@ def avg_pool3d(x, x, 'pooling_type', 'avg', 'ksize', kernel_size, 'strides', stride, 'paddings', padding, 'global_pooling', False, 'padding_algorithm', padding_algorithm, 'use_cudnn', True, 'ceil_mode', ceil_mode, - 'use_mkldnn', False, 'exclusive', not exclusive, 'data_format', + 'use_mkldnn', False, 'exclusive', exclusive, 'data_format', data_format) if divisor_override is None: return output diff --git a/python/paddle/nn/layer/pooling.py b/python/paddle/nn/layer/pooling.py index 0b0a4909f8550efad93db8c5dc7037a99640f771..07cd0f61aa716b7d35972c015f2103592c0c7d40 100755 --- a/python/paddle/nn/layer/pooling.py +++ b/python/paddle/nn/layer/pooling.py @@ -503,6 +503,7 @@ class MaxPool2D(layers.Layer): stride=self.stride, padding=self.padding, return_mask=self.return_mask, + ceil_mode=self.ceil_mode, data_format=self.data_format, name=self.name) @@ -594,6 +595,7 @@ class MaxPool3D(layers.Layer): stride=self.stride, padding=self.padding, return_mask=self.return_mask, + ceil_mode=self.ceil_mode, data_format=self.data_format, name=self.name)