Skip to content

Commit

Permalink
[Docathon] Fix add API Docs (PaddlePaddle#57434)
Browse files Browse the repository at this point in the history
* 0918API

* Apply suggestions from code review

Co-authored-by: zachary sun <[email protected]>

* 0923修改

---------

Co-authored-by: zachary sun <[email protected]>
  • Loading branch information
yuchen202 and sunzhongkai588 authored Sep 25, 2023
1 parent 7132407 commit ac889b9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 14 deletions.
5 changes: 4 additions & 1 deletion python/paddle/nn/layer/conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,10 @@ 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.
Note:
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]` ).
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 @@ -180,6 +180,7 @@ class InputSpec:
uint8. Default: float32.
name (str): The name/alias of the variable, see :ref:`api_guide_Name`
for more details.
stop_gradient (bool, optional): A boolean that mentions whether gradient should flow. Default is False, means don't stop calculate gradients.
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 @@ -2896,11 +2896,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 @@ -1281,7 +1281,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

0 comments on commit ac889b9

Please sign in to comment.