Skip to content

Commit 510601b

Browse files
committed
test=develop
1 parent 982e489 commit 510601b

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

python/paddle/fluid/layers/nn.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,12 +2139,16 @@ def pool2d(input,
21392139
input tensor is NCHW, where N is batch size, C is
21402140
the number of channels, H is the height of the
21412141
feature, and W is the width of the feature.
2142-
pool_size (int|list|tuple): The pool kernel size. If pool kernel size is a tuple,
2142+
pool_size (int|list|tuple): The pool kernel size. If pool kernel size is a tuple or list,
21432143
it must contain two integers, (pool_size_Height, pool_size_Width).
21442144
Otherwise, the pool kernel size will be a square of an int.
21452145
pool_type: ${pooling_type_comment}
2146-
pool_stride (int): stride of the pooling layer.
2147-
pool_padding (int): padding size.
2146+
pool_stride (int|list|tuple): The pool stride size. If pool stride size is a tuple or list,
2147+
it must contain two integers, (pool_stride_Height, pool_stride_Width).
2148+
Otherwise, the pool stride size will be a square of an int.
2149+
pool_padding (int|list|tuple): The pool padding size. If pool padding size is a tuple,
2150+
it must contain two integers, (pool_padding_on_Height, pool_padding_on_Width).
2151+
Otherwise, the pool padding size will be a square of an int.
21482152
global_pooling (bool): ${global_pooling_comment}
21492153
use_cudnn (bool): ${use_cudnn_comment}
21502154
ceil_mode (bool): ${ceil_mode_comment}

python/paddle/fluid/tests/unittests/test_layers.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,12 @@ def test_pool2d(self):
206206
program = Program()
207207
with program_guard(program):
208208
x = layers.data(name='x', shape=[3, 224, 224], dtype='float32')
209-
self.assertIsNotNone(layers.pool2d(x, pool_size=[5, 3]))
209+
self.assertIsNotNone(
210+
layers.pool2d(
211+
x,
212+
pool_size=[5, 3],
213+
pool_stride=[1, 2],
214+
pool_padding=(2, 1)))
210215

211216
def test_lstm_unit(self):
212217
program = Program()

0 commit comments

Comments
 (0)