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

对多个文档按照要求修改 #5453

Merged
merged 10 commits into from
Dec 8, 2022
Merged

对多个文档按照要求修改 #5453

merged 10 commits into from
Dec 8, 2022

Conversation

yjphhw
Copy link
Contributor

@yjphhw yjphhw commented Nov 26, 2022

对paddle.nn.Unfold的任务进行了修改和完善
去掉了kernalsize的尺寸3x3,
把类型改为class,
修复了链接

对upsample中的该op ,以及一些符号错误进行了修正

PaddlePaddle/Paddle#48886

@paddle-bot
Copy link

paddle-bot bot commented Nov 26, 2022

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-5453.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html
预览工具的更多说明,请参考:[Beta]飞桨文档预览工具

@CLAassistant
Copy link

CLAassistant commented Nov 26, 2022

CLA assistant check
All committers have signed the CLA.

@yjphhw
Copy link
Contributor Author

yjphhw commented Nov 26, 2022

@Ligoml 请检查了,通过一下。

@yjphhw yjphhw changed the title 对paddle.nn.Unfold的任务进行修改 对多个文档按照要求修改 Nov 26, 2022
- **align_corners** (bool,可选)- 一个可选的 bool 型参数,如果为 True,则将输入和输出张量的 4 个角落像素的中心对齐,并保留角点像素的值。默认值为 True
- **align_mode** (int,可选)- 双线性插值的可选项。可以是 '0' 代表 src_idx = scale *(dst_indx + 0.5)-0.5;如果为'1',代表 src_idx = scale * dst_index。
- **data_format** (str,可选)- 指定输入的数据格式,输出的数据格式将与输入保持一致。对于 3-D Tensor,支持 NCHW(num_batches, channels, width),对于 4-D Tensor,支持 NCHW(num_batches, channels, height, width) 或者 NHWC(num_batches, height, width, channels),对于 5-D Tensor,支持 NCDHW(num_batches, channels, depth, height, width)或者 NDHWC(num_batches, depth, height, width, channels),默认值:'NCHW'。
- **align_corners** (bool,可选)- 一个可选的 bool 型参数,如果为 True,则将输入和输出张量的 4 个角落像素的中心对齐,并保留角点像素的值。默认值为 True
Copy link
Member

Choose a reason for hiding this comment

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

(bool,可选)- 之间加一个空格

默认值为 False

Copy link
Member

@SigureMo SigureMo Nov 28, 2022

Choose a reason for hiding this comment

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

这个默认值是不是没改

Copy link
Contributor Author

Choose a reason for hiding this comment

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

明白了

@yjphhw
Copy link
Contributor Author

yjphhw commented Nov 27, 2022

@SigureMo 已经修改了再检查一下。

@yjphhw yjphhw requested a review from SigureMo November 28, 2022 07:35
@yjphhw
Copy link
Contributor Author

yjphhw commented Nov 28, 2022 via email

@yjphhw yjphhw requested a review from SigureMo November 28, 2022 07:56
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

LGTM,@Ligoml 检查一下~

@yjphhw
Copy link
Contributor Author

yjphhw commented Nov 28, 2022

Docs-NEW 运行不通过,是不是没有给通过??? 麻烦给看一下 @SigureMo
2022-11-28 17:19:54 ==========================================================================================
2022-11-28 17:19:54 You must have one TPM (jzhang533/ZhangJun or momozi1996/MoYan or dingjiaweiww/DingJiaWei or Ligoml/LiMengLiu or sunzhongkai588/SunZhongKai) approval for the api change! docs/api/paddle for the management reason of API interface and API document.
2022-11-28 17:19:54 ==========================================================================================
2022-11-28 17:19:54 + exit 1
2022-11-28 17:19:54 + '[' 1 -ne 0 ']'

@SigureMo
Copy link
Member

根据提示等 @Ligoml 等人 review 即可

@Ligoml
Copy link
Collaborator

Ligoml commented Nov 30, 2022

@yjphhw 英文文档的修改pr好像还没有提?这里有一部分问题是需要修改英文源码的哈,比如这个 paddle.nn.Maxout 中文是对的,英文文档给参数 groups 增加了一个 optional 的标识,但其实这不是可选参数,是必选参数

英文文档可以通过点击源代码去找到位置,大部分是写在python里的
image

@@ -20,7 +20,7 @@ Maxout 激活层,创建一个可调用对象计算。

参数
::::::::::::
- **groups** (int) - 指定将输入张量的 channel 通道维度进行分组的数目。输出的通道数量为通道数除以组数。
- **groups** (int,可选) - 指定将输入张量的 channel 通道维度进行分组的数目。输出的通道数量为通道数除以组数。默认值为 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

paddle.nn.Maxout(groups, axis=1, name=None)
所以group其实应该是必选参数,没有默认值

Copy link
Contributor Author

Choose a reason for hiding this comment

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

其实这个翻译还是有点问题的,groups

英文的需要在paddle的源代码里改?也就是还需要下载 paddlepaddle的源?

Copy link
Member

Choose a reason for hiding this comment

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

英文的需要在paddle的源代码里改?也就是还需要下载 paddlepaddle的源?

对的,英文文档在 https://github.com/PaddlePaddle/paddle#5453 (comment) 说了怎么找相应的源代码

@@ -1,17 +1,17 @@
.. _cn_api_fluid_layers_unfold:

unfold
Unfold
Copy link
Collaborator

Choose a reason for hiding this comment

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

good job!英文文档删除一下 this op 吧~

- **size** (list|tuple|Variable|None) - 输出 Tensor,输入为 3D 张量时,形状为为(out_w)的 1-D Tensor。输入为 4D 张量时,形状为为(out_h, out_w)的 2-D Tensor。输入为 5-D Tensor 时,形状为(out_d, out_h, out_w)的 3-D Tensor。如果 :code:`out_shape` 是列表,每一个元素可以是整数或者形状为[1]的变量。如果 :code:`out_shape` 是变量,则其维度大小为 1。默认值为 None。
- **scale_factor** (float|Tensor|list|tuple|None)-输入的高度或宽度的乘数因子。out_shapescale 至少要设置一个。out_shape 的优先级高于 scale。默认值为 None。如果 scale_factor 是一个 list 或 tuple,它必须与输入的 shape 匹配。
- **size** (list|tuple|Tensor|None) - 输出 Tensor 的形状,输入为 3D 张量时,形状为为(out_w)的 1-D Tensor。输入为 4D 张量时,形状为为(out_h, out_w)的 2-D Tensor。输入为 5-D Tensor 时,形状为(out_d, out_h, out_w)的 3-D Tensor。如果 :code:`size` 是列表,每一个元素可以是整数或者形状为[1]的变量。如果 :code:`size` 是变量,则其维度大小为 1。默认值为 None。
- **scale_factor** (float|Tensor|list|tuple|None)-输入的深度、高度或宽度的缩放因子。:code:`size`:code:`scale_factor` 至少要设置一个。:code:`size` 的优先级高于:code:`scale_factor`。默认值为 None。如果 scale_factor 是一个 list 或 tuple,它必须与输入的 shape 匹配。
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- **scale_factor** (float|Tensor|list|tuple|None)-输入的深度、高度或宽度的缩放因子。:code:`size` 和 :code:`scale_factor` 至少要设置一个。:code:`size` 的优先级高于:code:`scale_factor`。默认值为 None。如果 scale_factor 是一个 list 或 tuple,它必须与输入的 shape 匹配。
- **scale_factor** (float|Tensor|list|tuple|None)-输入的深度、高度或宽度的缩放因子。:code:`size` 和 :code:`scale_factor` 至少要设置一个。:code:`size` 的优先级高于 :code:`scale_factor`。默认值为 None。如果 scale_factor 是一个 list 或 tuple,它必须与输入的 shape 匹配。

Copy link
Collaborator

Choose a reason for hiding this comment

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

另外 size=None, scale_factor=None ,所以这俩是可选参数啦

@@ -29,13 +29,13 @@ mse_loss
:::::::::
- **input** (Tensor) - 预测值,维度为 :math:`[N_1, N_2, ..., N_k]` 的多维 Tensor。数据类型为 float32 或 float64。
- **label** (Tensor) - 目标值,维度为 :math:`[N_1, N_2, ..., N_k]` 的多维 Tensor。数据类型为 float32 或 float64。
- **reduction** (string, optional) - 输出的归约方法可以是'none'、'mean'或'sum'。
- **reduction** (string, 可选) - 输出的归约方法可以是'none'、'mean'或'sum'。
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- **reduction** (string, 可选) - 输出的归约方法可以是'none'、'mean'或'sum'。
- **reduction** (str, 可选) - 输出的归约方法可以是'none'、'mean'或'sum'。

Copy link
Collaborator

Choose a reason for hiding this comment

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

顺便英文文档也改一下吧~

@yjphhw
Copy link
Contributor Author

yjphhw commented Nov 30, 2022 via email

@Ligoml
Copy link
Collaborator

Ligoml commented Dec 1, 2022

英文文档需要在paddle的源码里的docstring里改?

是的,要在paddle repo下提一个pr

@Ligoml
Copy link
Collaborator

Ligoml commented Dec 8, 2022

辛苦处理一下冲突哈

@yjphhw
Copy link
Contributor Author

yjphhw commented Dec 8, 2022

好的,下午就提交。因为paddle的库之前克隆都失败了。

@yjphhw
Copy link
Contributor Author

yjphhw commented Dec 8, 2022

辛苦处理一下冲突哈

中英文已经提交。

Copy link
Collaborator

@Ligoml Ligoml left a comment

Choose a reason for hiding this comment

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

good job!LGTM for docs

@Ligoml Ligoml merged commit 98393a3 into PaddlePaddle:develop Dec 8, 2022
@yjphhw
Copy link
Contributor Author

yjphhw commented Dec 8, 2022

@Ligoml 感谢 耐心的指导! 其他的几个我也想修改,但是描述比较模糊,之前看到有群的请问怎么加入来具体咨询。

@yjphhw yjphhw deleted the hwdoc branch December 9, 2022 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants