From 1127d0d33f7215a713fa07394075a49880cf2389 Mon Sep 17 00:00:00 2001 From: Bai Yifan Date: Tue, 1 Sep 2020 16:39:02 +0800 Subject: [PATCH] fix adaptive_avg_1d outputsize type issue, test=document_fix (#26869) --- python/paddle/nn/functional/pooling.py | 5 ++--- python/paddle/nn/layer/pooling.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/python/paddle/nn/functional/pooling.py b/python/paddle/nn/functional/pooling.py index c8790a75901..b4a713a1964 100755 --- a/python/paddle/nn/functional/pooling.py +++ b/python/paddle/nn/functional/pooling.py @@ -847,8 +847,7 @@ def adaptive_avg_pool1d(x, output_size, name=None): with shape [N, C, L]. The format of input tensor is NCL, where N is batch size, C is the number of channels, L is the length of the feature. The data type is float32 or float64. - output_size (int|list|tuple): The pool kernel size. If pool kernel size is a tuple or list, - it must contain one int. + output_size (int): The target output size. It must be an integer. name(str, optional): For detailed information, please refer to :ref:`api_guide_Name`. Usually name is no need to set and None by default. @@ -856,7 +855,7 @@ def adaptive_avg_pool1d(x, output_size, name=None): 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 or list or tuple with length as 1. + ValueError: 'output_size' should be an integer. Examples: .. code-block:: python # average adaptive pool1d diff --git a/python/paddle/nn/layer/pooling.py b/python/paddle/nn/layer/pooling.py index 6f6b5678497..4cb661cf541 100755 --- a/python/paddle/nn/layer/pooling.py +++ b/python/paddle/nn/layer/pooling.py @@ -613,8 +613,7 @@ class AdaptiveAvgPool1d(layers.Layer): Output(i) &= \\frac{sum(Input[lstart:lend])}{(lstart - lend)} Args: - output_size (int|list|tuple): The pool kernel size. If pool kernel size is a tuple or list, - it must contain one int. + output_size (int): The target output size. It must be an integer. name(str, optional): For detailed information, please refer to :ref:`api_guide_Name`. Usually name is no need to set and None by default. @@ -623,7 +622,7 @@ class AdaptiveAvgPool1d(layers.Layer): None. Raises: - ValueError: 'pool_size' should be a integer or list or tuple with length as 1. + ValueError: 'output_size' should be an integer. Shape: - x: 3-D tensor. -- GitLab