未验证 提交 b372ab3e 编写于 作者: W Walter 提交者: GitHub

fix adaptive_avg_pool1d doc bug (#42721)

* fix adaptive_avg_pool1d doc bug

* fix adaptive_avg_pool1d doc bug
上级 a52f8e4a
......@@ -1267,10 +1267,9 @@ def adaptive_avg_pool1d(x, output_size, name=None):
Returns:
Tensor: The output tensor of adaptive average pooling result. The data type is same
as input tensor.
Raises:
ValueError: 'output_size' should be an integer.
Examples:
.. code-block:: python
:name: code-example1
# average adaptive pool1d
# suppose input data in shape of [N, C, L], `output_size` is m or [m],
......@@ -1286,10 +1285,9 @@ def adaptive_avg_pool1d(x, output_size, name=None):
#
import paddle
import paddle.nn.functional as F
import numpy as np
data = paddle.to_tensor(np.random.uniform(-1, 1, [1, 3, 32]).astype(np.float32))
pool_out = F.adaptive_average_pool1d(data, output_size=16)
data = paddle.uniform([1, 3, 32])
pool_out = F.adaptive_avg_pool1d(data, output_size=16)
# pool_out shape: [1, 3, 16])
"""
pool_type = 'avg'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册