Skip to content

Commit 982e489

Browse files
committed
test=develop
1 parent 1d9b2a4 commit 982e489

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

python/paddle/fluid/layers/nn.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,8 +2139,9 @@ 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): The side length of pooling windows. All pooling
2143-
windows are squares with pool_size on a side.
2142+
pool_size (int|list|tuple): The pool kernel size. If pool kernel size is a tuple,
2143+
it must contain two integers, (pool_size_Height, pool_size_Width).
2144+
Otherwise, the pool kernel size will be a square of an int.
21442145
pool_type: ${pooling_type_comment}
21452146
pool_stride (int): stride of the pooling layer.
21462147
pool_padding (int): padding size.

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@ def test_sequence_unpad(self):
202202
self.assertIsNotNone(layers.sequence_unpad(x=x, length=length))
203203
print(str(program))
204204

205+
def test_pool2d(self):
206+
program = Program()
207+
with program_guard(program):
208+
x = layers.data(name='x', shape=[3, 224, 224], dtype='float32')
209+
self.assertIsNotNone(layers.pool2d(x, pool_size=[5, 3]))
210+
205211
def test_lstm_unit(self):
206212
program = Program()
207213
with program_guard(program):

0 commit comments

Comments
 (0)