From eb4ad5094af931766a69a36f48b6db40211e9bee Mon Sep 17 00:00:00 2001 From: xiaoting <31891223+tink2123@users.noreply.github.com> Date: Thu, 24 Feb 2022 14:12:53 +0800 Subject: [PATCH] [doc]Fix maxunpool2d example (#39862) * fix maxunpool2d example, test=document_fix * fix maxunpool2d example, test=document_fix --- python/paddle/nn/layer/pooling.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/paddle/nn/layer/pooling.py b/python/paddle/nn/layer/pooling.py index 68808c6354a..c664c6e318c 100755 --- a/python/paddle/nn/layer/pooling.py +++ b/python/paddle/nn/layer/pooling.py @@ -1257,9 +1257,8 @@ class MaxUnPool2D(Layer): import paddle import paddle.nn.functional as F - import numpy as np - data = paddle.rand(shape=[1,1,7,7]) + data = paddle.rand(shape=[1,1,6,6]) pool_out, indices = F.max_pool2d(data, kernel_size=2, stride=2, padding=0, return_mask=True) # pool_out shape: [1, 1, 3, 3], indices shape: [1, 1, 3, 3] Unpool2D = paddle.nn.MaxUnPool2D(kernel_size=2, padding=0) -- GitLab