Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docathon] Fix NO.51-64 API Label #57606

Closed
wants to merge 13 commits into from
6 changes: 3 additions & 3 deletions python/paddle/nn/functional/pooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ def max_unpool2d(
):
r"""
This API implements max unpooling 2d opereation.
See more details in :ref:`api_nn_pooling_MaxUnPool2D` .
See more details in :ref:`api_paddle_nn_MaxUnPool2D` .


Args:
Expand Down Expand Up @@ -1347,8 +1347,8 @@ def max_pool3d(
name=None,
):
"""
This API implements max pooling 2d operation.
See more details in :ref:`api_nn_pooling_MaxPool3d` .
This API implements max pooling 3d operation.
See more details in :ref:`api_paddle_nn_MaxPool3D` .

Args:
x (Tensor): The input tensor of pooling operator, which is a 5-D tensor with
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/nn/functional/vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ def pixel_unshuffle(x, downscale_factor, data_format="NCHW", name=None):
def channel_shuffle(x, groups, data_format="NCHW", name=None):
"""
This API implements channel shuffle operation.
See more details in :ref:`api_nn_vision_ChannelShuffle`.
See more details in :ref:`api_paddle_nn_ChannelShuffle`.

Parameters:
x (Tensor): 4-D tensor, the data type should be float32 or float64.
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/sparse/nn/functional/pooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def max_pool3d(
):
"""
Implements sparse max pooling 3d operation.
See more details in :ref:`api_sparse_pooling_MaxPool3d` .
See more details in :ref:`api_paddle_sparse_nn_MaxPool3D` .

Args:
x (Tensor): The input SparseCooTensor of pooling operator, which is a 5-D tensor with
Expand Down
14 changes: 7 additions & 7 deletions python/paddle/static/nn/sequence_lod.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def sequence_softmax(input, use_cudnn=False, name=None):
r"""

Note:
The input type of the OP must be Tensor. For Tensor, use:** :ref:`api_static_nn_softmax`
The input type of the OP must be Tensor. For Tensor, use:** :ref:`api_paddle_nn_functional_softmax`
sunzhongkai588 marked this conversation as resolved.
Show resolved Hide resolved

A LoD-tensor can be regarded as several sequences, and this op apply softmax algo on each sequence.
The shape of input Tensor can be :math:`[N, 1]` or :math:`[N]`, where :math:`N`
Expand Down Expand Up @@ -254,7 +254,7 @@ def sequence_pool(input, pool_type, is_test=False, pad_value=0.0):
r"""

Note:
Only receives Tensor as input. If your input is Tensor, please use pool2d Op.(static.nn.** :ref:`api_static_nn_pool2d` ).
Only receives Tensor as input. If your input is Tensor, please use pool2d Op.(static.nn.** :ref:`api_paddle_static_nn_sequence_pool` ).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sunzhongkai588 这个需要和中文这样不?我感觉需要,因为确实两个都是
屏幕截图 2023-09-21 230948

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sunzhongkai588 这个需要和中文这样不?我感觉需要,因为确实两个都是
屏幕截图 2023-09-21 230948

改成引用这两个 API 叭

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Only receives Tensor as input. If your input is Tensor, please use pool2d Op.(static.nn.** :ref:`api_paddle_static_nn_sequence_pool` ).
Only receives Tensor as input. If your input is Tensor, please use pool2d Op.(static.nn.** :ref:`api_paddle_nn_functional_avg_pool2d` or :ref:`api_paddle_nn_functional_max_pool2d` ).


This operator only supports Tensor as input. It will apply specified pooling
operation on the input Tensor. It pools features of all time-steps of each
Expand Down Expand Up @@ -372,7 +372,7 @@ def sequence_concat(input, name=None):
"""

Note:
Only receives Tensor as input. If your input is Tensor, please use concat Op.(static.nn.** :ref:`api_static_nn_concat` ).
Only receives Tensor as input. If your input is Tensor, please use concat Op.(static.nn.** :ref:`api_paddle_concat` ).

This operator only supports Tensor as input. It concatenates the multiple Tensor from input by the LoD information,
and outputs the concatenated Tensor.
Expand Down Expand Up @@ -921,7 +921,7 @@ def sequence_pad(x, pad_value, maxlen=None, name=None):
to ``maxlen``). The padding value is defined by ``pad_value``, and will be
appended to the tail of sequences. The result is a Python tuple ``(Out, Length)``:
the Tensor ``Out`` is the padded sequences, and Tensor ``Length`` is
the length information of input sequences. For removing padding data (unpadding operation), See :ref:`api_static_static_sequence_unpad`.
the length information of input sequences. For removing padding data (unpadding operation), See :ref:`api_paddle_static_nn_sequence_unpad`.

Note:
Please note that the input ``x`` should be Tensor.
Expand Down Expand Up @@ -1039,7 +1039,7 @@ def sequence_unpad(x, length, name=None):
"""

Note:
The input of the OP is Tensor and the output is Tensor. For padding operation, See:** :ref:`api_static_nn_sequence_pad`
The input of the OP is Tensor and the output is Tensor. For padding operation, See:** :ref:`api_paddle_static_nn_sequence_pad`

Remove the padding data from the input based on the length information and returns a Tensor.

Expand Down Expand Up @@ -1123,7 +1123,7 @@ def sequence_reshape(input, new_dim):
"""

Note:
Only receives Tensor as input. If your input is Tensor, please use reshape Op.(static.nn.** :ref:`api_static_nn_reshape` ).
Only receives Tensor as input. If your input is Tensor, please use reshape Op.(static.nn.** :ref:`api_paddle_reshape` ).

Only supports Tensor as input. Given :attr:`new_dim` ,
it will compute new shape according to original length of each sequence,
Expand Down Expand Up @@ -1420,7 +1420,7 @@ def sequence_mask(x, maxlen=None, dtype='int64', name=None):
def sequence_reverse(x, name=None):
"""
Note:
Only receives Tensor as input. If your input is Tensor, please use reverse Op.(static.nn.** :ref:`api_static_nn_reverse` ).
Only receives Tensor as input. If your input is Tensor, please use reverse Op.(static.nn.** :ref:`api_paddle_static_nn_sequence_reverse` ).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sunzhongkai588 这个reverse我不是很清楚是否存在 reverse Op(这个ref),在api官网文档里搜索 reverse 没有搜索到

Copy link
Contributor

@sunzhongkai588 sunzhongkai588 Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

屏幕截图 2023-09-21 233450
@sunzhongkai588 多个 api 的 NOTE 都出现 static.nn.** 的情况,其中 static.nn 好像没有意义,是否要删除呢?

可能已经替换成 flip了,reverse API 调用的op好像就是 flip@zoooo0820 麻烦确认下~

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改成引用 paddle.flip

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Only receives Tensor as input. If your input is Tensor, please use reverse Op.(static.nn.** :ref:`api_paddle_static_nn_sequence_reverse` ).
Only receives Tensor as input. If your input is Tensor, please use reverse Op.(static.nn.** :ref:`api_paddle_flip` ).


Only supports Tensor as input. It will reverse each sequence for input Tensor.
Currently it only supports 1-level Tensor. This operator is very useful when building a
Expand Down
4 changes: 2 additions & 2 deletions python/paddle/tensor/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1630,7 +1630,7 @@ def flatten(x, start_axis=0, stop_axis=-1, name=None):
def flatten_(x, start_axis=0, stop_axis=-1, name=None):
"""
Inplace version of ``flatten`` API, the output Tensor will be inplaced with input ``x``.
Please refer to :ref:`api_tensor_flatten`.
Please refer to :ref:`api_paddle_flatten`.
"""
if not (isinstance(x, Variable)):
raise ValueError("The input x should be a Tensor")
Expand Down Expand Up @@ -4723,7 +4723,7 @@ def put_along_axis(arr, indices, values, axis, reduce='assign'):
def put_along_axis_(arr, indices, values, axis, reduce='assign'):
r"""
Inplace version of ``put_along_axis`` API, the output Tensor will be inplaced with input ``arr``.
Please refer to :ref:`api_tensor_put_along_axis`.
Please refer to :ref:`api_paddle_put_along_axis`.
"""
if len(arr.shape) != len(indices.shape):
raise ValueError(
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/tensor/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ def uniform_(x, min=-1.0, max=1.0, seed=0, name=None):
"""
This is the inplace version of OP ``uniform``, which returns a Tensor filled
with random values sampled from a uniform distribution. The output Tensor will
be inplaced with input ``x``. Please refer to :ref:`api_tensor_uniform`.
be inplaced with input ``x``. Please refer to :ref:`api_paddle_uniform`.

Args:
x(Tensor): The input tensor to be filled with random values.
Expand Down