未验证 提交 1127d0d3 编写于 作者: B Bai Yifan 提交者: GitHub

fix adaptive_avg_1d outputsize type issue, test=document_fix (#26869)

上级 61107aa6
...@@ -847,8 +847,7 @@ def adaptive_avg_pool1d(x, output_size, name=None): ...@@ -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, 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 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. 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, output_size (int): The target output size. It must be an integer.
it must contain one int.
name(str, optional): For detailed information, please refer name(str, optional): For detailed information, please refer
to :ref:`api_guide_Name`. Usually name is no need to set and to :ref:`api_guide_Name`. Usually name is no need to set and
None by default. None by default.
...@@ -856,7 +855,7 @@ def adaptive_avg_pool1d(x, output_size, name=None): ...@@ -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 Tensor: The output tensor of adaptive average pooling result. The data type is same
as input tensor. as input tensor.
Raises: Raises:
ValueError: 'output_size' should be an integer or list or tuple with length as 1. ValueError: 'output_size' should be an integer.
Examples: Examples:
.. code-block:: python .. code-block:: python
# average adaptive pool1d # average adaptive pool1d
......
...@@ -613,8 +613,7 @@ class AdaptiveAvgPool1d(layers.Layer): ...@@ -613,8 +613,7 @@ class AdaptiveAvgPool1d(layers.Layer):
Output(i) &= \\frac{sum(Input[lstart:lend])}{(lstart - lend)} Output(i) &= \\frac{sum(Input[lstart:lend])}{(lstart - lend)}
Args: Args:
output_size (int|list|tuple): The pool kernel size. If pool kernel size is a tuple or list, output_size (int): The target output size. It must be an integer.
it must contain one int.
name(str, optional): For detailed information, please refer name(str, optional): For detailed information, please refer
to :ref:`api_guide_Name`. Usually name is no need to set and to :ref:`api_guide_Name`. Usually name is no need to set and
None by default. None by default.
...@@ -623,7 +622,7 @@ class AdaptiveAvgPool1d(layers.Layer): ...@@ -623,7 +622,7 @@ class AdaptiveAvgPool1d(layers.Layer):
None. None.
Raises: Raises:
ValueError: 'pool_size' should be a integer or list or tuple with length as 1. ValueError: 'output_size' should be an integer.
Shape: Shape:
- x: 3-D tensor. - x: 3-D tensor.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册