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 add API Docs #57434

Merged
merged 3 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion python/paddle/nn/layer/conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,11 @@ class Conv2DTranspose(_ConvNd):
* :math:`\ast`: Convolution operation.
* :math:`b`: Bias value, a 1-D ``Tensor`` with shape [M].
* :math:`\sigma`: Activation function.
* :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different.
* :math:`Out`: Output value, a 4-D ``Tensor`` with NCHW or NHWC format, the shape of :math:`Out` and :math:`X` may be different.
yuchen202 marked this conversation as resolved.
Show resolved Hide resolved

::note:
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

If output_size is None, :math:`H_{out}` = :math:`H^\prime_{out}` , :math:`W_{out}` = :math:`W^\prime_{out}`. Otherwise, the specified output_size_height (the height of the output feature layer) :math:`H_{out}` should be between:math:`H^\prime_{out}` and :math:`H^\prime_{out} + strides[0]` (excluding :math:`H^\prime_{out} + strides[0]` ).
yuchen202 marked this conversation as resolved.
Show resolved Hide resolved
The specified output_size_width :math:`W_{out}` should be between :math:`W^\prime_{out}` and :math:`W^\prime_{out} + strides[1]` (excluding :math:`W^\prime_{out} + strides[1]`).

Parameters:
in_channels(int): The number of channels in the input image.
Expand Down
1 change: 1 addition & 0 deletions python/paddle/static/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ class InputSpec:
uint8. Default: float32.
name (str): The name/alias of the variable, see :ref:`api_guide_Name`
for more details.
stop_gradient ():留空,坐等孙师傅指导。
Copy link
Contributor

Choose a reason for hiding this comment

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

stop_gradient (bool, optional): A boolean that mentions whether gradient should flow. Default is False, means don't stop calculate gradients. 这段不写也没事

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
stop_gradient ():留空,坐等孙师傅指导。

删掉吧


Examples:
.. code-block:: python
Expand Down
6 changes: 1 addition & 5 deletions python/paddle/tensor/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2900,11 +2900,7 @@ def scatter(x, index, updates, overwrite=True, name=None):
x (Tensor): The input N-D Tensor with ndim>=1. Data type can be float32, float64.
index (Tensor): The index is a 1-D or 0-D Tensor. Data type can be int32, int64. The length of index cannot exceed updates's length, and the value in index cannot exceed input's length.
updates (Tensor): Update input with updates parameter based on index. When the index is a 1-D tensor, the updates shape should be the same as input, and dim value with dim > 1 should be the same as input. When the index is a 0-D tensor, the updates should be a (N-1)-D tensor, the ith dim of the updates should be queal with the (i+1)th dim of the input.
overwrite (bool, optional): The mode that updating the output when there are same indices.

If True, use the overwrite mode to update the output of the same index,
if False, use the accumulate mode to update the output of the same index. Default value is True.

overwrite (bool, optional): The mode that updating the output when there are same indices.If True, use the overwrite mode to update the output of the same index,if False, use the accumulate mode to update the output of the same index. Default value is True.
name(str, optional): The default value is None. Normally there is no need for user to set this property. For more information, please refer to :ref:`api_guide_Name` .

Returns:
Expand Down
7 changes: 1 addition & 6 deletions python/paddle/tensor/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,16 +643,11 @@ def add(x, y, name=None):
$X$ the tensor of any dimension.
$Y$ the tensor whose dimensions must be less than or equal to the dimensions of $X$.

There are two cases for this operator:
This operator is used in the following cases:

1. The shape of $Y$ is the same with $X$.
2. The shape of $Y$ is a continuous subsequence of $X$.

For case 2:

1. Broadcast $Y$ to match the shape of $X$, where axis is the start dimension index for broadcasting $Y$ onto $X$.
2. If $axis$ is -1 (default), $axis$=rank($X$)-rank($Y$).
3. The trailing dimensions of size 1 for $Y$ will be ignored for the consideration of subsequence, such as shape($Y$) = (2, 1) => (2).

For example:

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 @@ -1078,7 +1078,7 @@ def rand(shape, dtype=None, name=None):
If ``shape`` is an Tensor, it should be an 1-D Tensor which represents a list.
dtype (str|np.dtype, optional): The data type of the output Tensor.
Supported data types: float32, float64.
Default is None, use global default dtype (see ``get_default_dtype``
Default is None, use global default dtype (see :ref:`get_default_dtype`
for details).
name (str, optional): The default value is None. Normally there is no
need for user to set this property. For more information, please
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/vision/models/resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def resnet50(pretrained=False, **kwargs):
Args:
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`ResNet <api_paddle_vision_ResNet>`.
**kwargs (optional): Additional keyword arguments. For details, please refer to :ref:`ResNet <api_paddle_vision_models_ResNet>`.

Returns:
:ref:`api_paddle_nn_Layer`. An instance of ResNet 50-layer model.
Expand Down