From 51d6897b13e9e19d9bf951fbdac6b73250d223bc Mon Sep 17 00:00:00 2001 From: fanjibin Date: Thu, 23 Feb 2023 22:54:45 +0800 Subject: [PATCH] modify adaptivemaxpool3d docs --- .../nn/mindspore.nn.AdaptiveMaxPool3d.rst | 4 ++-- .../ops/mindspore.ops.func_adaptive_max_pool3d.rst | 4 ++-- mindspore/python/mindspore/nn/layer/pooling.py | 14 ++++++-------- mindspore/python/mindspore/ops/function/nn_func.py | 13 ++++++------- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/docs/api/api_python/nn/mindspore.nn.AdaptiveMaxPool3d.rst b/docs/api/api_python/nn/mindspore.nn.AdaptiveMaxPool3d.rst index 2fdda5799f7..524db04489c 100644 --- a/docs/api/api_python/nn/mindspore.nn.AdaptiveMaxPool3d.rst +++ b/docs/api/api_python/nn/mindspore.nn.AdaptiveMaxPool3d.rst @@ -3,10 +3,10 @@ mindspore.nn.AdaptiveMaxPool3d .. py:class:: mindspore.nn.AdaptiveMaxPool3d(output_size, return_indices=False) - 对输入Tensor,提供三维自适应最大池化操作。对于任何输入尺寸,输出的大小为 :math:`(D, H, W)` 。输出特征的数量与输入特征的数量相同。 + 对输入Tensor执行三维自适应最大池化操作。对于任何输入尺寸,输出的size为 :math:`(D, H, W)` 。 参数: - - **output_size** (Union[int, tuple]) - 表示输出特征图的尺寸,输入可以是tuple :math:`(D, H, W)`,也可以是一个int值D来表示输出尺寸为 :math:`(D, D, D)` 。:math:`D` , :math:`H` 和 :math:`W` 可以是int型整数或者None,其中None表示输出大小与对应的输入的大小相同。 + - **output_size** (Union[int, tuple]) - 指定输出的size。可以用一个整数统一表示输出的深度、高度和宽度,或者用一个整数三元组来分别表示输出的深度、高度和宽度。指定的值必须是正整数。如果是None则表示对应维度输出和输入size相同。 - **return_indices** (bool) - 如果 `return_indices` 为True,将会输出最大值对应的索引,否则不输出索引。默认为False。 输入: diff --git a/docs/api/api_python/ops/mindspore.ops.func_adaptive_max_pool3d.rst b/docs/api/api_python/ops/mindspore.ops.func_adaptive_max_pool3d.rst index 4d1d570f49b..39a0df40b48 100644 --- a/docs/api/api_python/ops/mindspore.ops.func_adaptive_max_pool3d.rst +++ b/docs/api/api_python/ops/mindspore.ops.func_adaptive_max_pool3d.rst @@ -3,11 +3,11 @@ mindspore.ops.adaptive_max_pool3d .. py:function:: mindspore.ops.adaptive_max_pool3d(input, output_size, return_indices=False) - 对由多个平面组成的的输入Tensor,应用三维的自适应最大池化操作。对于任何输入尺寸,指定输出的尺寸都为 :math:`(D, H, W)`,但是输入和输出特征的数目不会变化。 + 对输入Tensor执行三维的自适应最大池化操作。对于任何输入尺寸,指定输出的size都为 :math:`(D, H, W)`。 参数: - **input** (Tensor) - shape为 :math:`(C, D, H, W)` 或 :math:`(N,C, D, H, W)` 的Tensor,支持的数据类型包括int8、int16、int32、int64、uint8、uint16、uint32、uint64、float16、float32、float64。 - - **output_size** (Union[int, tuple]) - 表示输出特征图的尺寸,输入可以是个tuple :math:`(D, H, W)`,也可以是一个int值D来表示输出尺寸为 :math:`(D, D, D)` 。:math:`D` , :math:`H` 和 :math:`W` 可以是int型整数或者None,其中None表示输出大小与对应的输入的大小相同。 + - **output_size** (Union[int, tuple]) - 指定输出的size。可以用一个整数统一表示输出的深度、高度和宽度,或者用一个整数三元组来分别表示输出的深度、高度和宽度。指定的值必须是正整数。如果是None则表示对应维度输出和输入size相同。 - **return_indices** (bool,可选) - 如果 `return_indices` 为True,将会输出最大值对应的索引,否则不输出索引。默认值为False。 返回: diff --git a/mindspore/python/mindspore/nn/layer/pooling.py b/mindspore/python/mindspore/nn/layer/pooling.py index 0af4bb11d67..c7eb15e1e5d 100644 --- a/mindspore/python/mindspore/nn/layer/pooling.py +++ b/mindspore/python/mindspore/nn/layer/pooling.py @@ -1131,16 +1131,14 @@ class AdaptiveMaxPool2d(Cell): class AdaptiveMaxPool3d(Cell): r""" - Applies a 3D adaptive max pooling over an input signal composed of several input planes. - - The output is of size :math:`(D, H, W)`, for any input size. - The number of output features is equal to the number of input planes. + Calculates the 3D adaptive max pooling for an input Tensor. + That is, for any input size, the size of the specified output is :math:`(D, H, W)`. Args: - output_size (Union[int, tuple]): The target output size is :math:`(D, H, W)`. - `ouput_size` can be a tuple with 3 elements, or a single D for :math:`(D, D, D)`. :math:`D`, - :math:`H` and :math:`W` can be int or None which means the output size is the same as that of - the input. + output_size (Union[int, tuple]): The specified output size, which is an integer that represents depth, + height and width, or a tuple of three int numbers that represent depth, height and width respectively. + The value must be a positive integer. If it is None, the output size and input size of the corresponding + dimension are the same. return_indices (bool): If `return_indices` is True, the indices of max value would be output. Default: False. diff --git a/mindspore/python/mindspore/ops/function/nn_func.py b/mindspore/python/mindspore/ops/function/nn_func.py index 37b84cc86a9..e16da1d727d 100644 --- a/mindspore/python/mindspore/ops/function/nn_func.py +++ b/mindspore/python/mindspore/ops/function/nn_func.py @@ -706,17 +706,16 @@ def adaptive_max_pool2d(input, output_size, return_indices=False): def adaptive_max_pool3d(input, output_size, return_indices=False): r""" - Applies a 3D adaptive max pooling over an input signal composed of several input planes. - - The output is of size :math:`(D, H, W)`, for any input size. - The number of output features is equal to the number of input planes. + Calculates the 3D adaptive max pooling for an input Tensor. + That is, for any input size, the size of the specified output is :math:`(D, H, W)`. Args: input (Tensor): Tensor, with shape :math:`(C, D, H, W)` or :math:`(N, C, D, H, W)`, which support int8, int16, int32, int64, uint8, uint16, uint32, uint64, float16, float32 or float64 data type. - output_size (Union[int, tuple]): The target output size. `ouput_size` can be a tuple :math:`(D, H, W)`, - or an int D for :math:`(D, D, D)`. :math:`D`, :math:`H` and :math:`W` can be int or None - which means the output size is the same as that of the input. + output_size (Union[int, tuple]): The specified output size, which is an integer that represents depth, + height and width, or a tuple of three int numbers that represent depth, height and width respectively. + The value must be a positive integer. If it is None, the output size and input size of the corresponding + dimension are the same. return_indices (bool, optional): If `return_indices` is True, the indices of max value would be output, else would not be output. Default: False.