未验证 提交 c3d50af8 编写于 作者: W Wei Shengyu 提交者: GitHub

Fix max_pool3d doc, test=document_fix (#42715)

* fix pooling doc

* fix typo test=document_fix

* fix doc typo, test=document_fix
上级 b372ab3e
...@@ -1160,22 +1160,21 @@ def max_pool3d(x, ...@@ -1160,22 +1160,21 @@ def max_pool3d(x,
import paddle import paddle
import paddle.nn.functional as F import paddle.nn.functional as F
import numpy as np
# max pool3d # max pool3d
x = paddle.to_tensor(np.random.uniform(-1, 1, [1, 3, 32, 32, 32]).astype(np.float32)) x = paddle.uniform([1, 3, 32, 32, 32])
output = F.max_pool2d(x, output = F.max_pool3d(x,
kernel_size=2, kernel_size=2,
stride=2, padding=0) stride=2, padding=0)
output.shape [1, 3, 16, 16, 16] # output.shape [1, 3, 16, 16, 16]
# for return_mask=True # for return_mask=True
x = paddle.to_tensor(np.random.uniform(-1, 1, [1, 3, 32, 32, 32]).astype(np.float32)) x = paddle.uniform([1, 3, 32, 32, 32])
output, max_indices = paddle.nn.functional.max_pool3d(x, output, max_indices = paddle.nn.functional.max_pool3d(x,
kernel_size = 2, kernel_size = 2,
stride = 2, stride = 2,
padding=0, padding=0,
return_mask=True) return_mask=True)
# output.shape [None, 3, 16, 16, 16], max_indices.shape [None, 3, 16, 16, 16], # output.shape [1, 3, 16, 16, 16], max_indices.shape [1, 3, 16, 16, 16]
""" """
kernel_size = utils.convert_to_list(kernel_size, 3, 'pool_size') kernel_size = utils.convert_to_list(kernel_size, 3, 'pool_size')
if stride is None: if stride is None:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册