-
Notifications
You must be signed in to change notification settings - Fork 777
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
fix nn.Pad1D/2D/3D class issue #5126
Conversation
docs/api/paddle/multiplex_cn.rst
Outdated
COPY-FROM: paddle.multiplex:code-example1 | ||
======= | ||
COPY-FROM: paddle.multiplex:code-example1 | ||
>>>>>>> 946e985763dcc3ae0f029147b8141c3af4fd9d9a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里处理冲突出问题啦~
docs/api/paddle/nn/Pad1D_cn.rst
Outdated
@@ -13,11 +13,11 @@ Pad1D | |||
|
|||
- **padding** (Tensor | List[int] | int) - 填充大小。如果是int,则在所有待填充边界使用相同的填充, | |||
否则填充的格式为[pad_left, pad_right]。 | |||
- **mode** (str) - padding的四种模式,分别为 ``'constant'``, ``'reflect'``, ``'replicate'`` 和 ``'circular'``。 | |||
- **mode** (str, 可选) - padding的四种模式,分别为 ``'constant'``, ``'reflect'``, ``'replicate'`` 和 ``'circular'``。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **mode** (str, 可选) - padding的四种模式,分别为 ``'constant'``, ``'reflect'``, ``'replicate'`` 和 ``'circular'``。 | |
- **mode** (str,可选) - padding的四种模式,分别为 ``'constant'``, ``'reflect'``, ``'replicate'`` 和 ``'circular'``。 |
这里是中文逗号~
docs/api/paddle/nn/Pad1D_cn.rst
Outdated
@@ -31,11 +31,11 @@ Pad1D | |||
|
|||
import paddle | |||
import paddle.nn as nn | |||
import numpy as np | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
示例代码直接 COPY-FROM 吧,如果 copy 失败了可以找我,我们一起解决呀~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
print(result) | ||
# [[[0. 1. 2. 3. 0. 0.] | ||
# [0. 4. 5. 6. 0. 0.]]] | ||
COPY-FROM: Paddle.nn.layer.common.Pad1D(Layer):code-example1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COPY-FROM: paddle.nn.Pad1D
在确定唯一的情况下,不建议加一个 :name:
属性哒,英文那面也删一下
看下面的 review 消息,直接 merge 上游修改即可,因为这些上游改过了,当然英文那面也是不需要加 :name:
的
- **value** (float32, 可选) - 以 ``'constant'`` 模式填充区域时填充的值。默认值为0.0。 | ||
- **data_format** (str, 可选) - 指定输入的format,可为 ``'NCL'`` 或者 ``'NLC'``,默认值为 ``'NCL'``。 | ||
- **name** (str, 可选) - 该参数供开发人员打印调试信息时使用,具体用法请参见 :ref:`api_guide_Name` ,缺省值为None。 | ||
- **value** (float32, 可选) - 以 ``'constant'`` 模式填充区域时填充的值。默认值为0.0。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改为中文逗号后后面不需要加空格
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注意本地需要用 pre-commit 来处理下代码风格的问题,比如这里中英文(数字)之间要有空格
如果本地是大小写不敏感的文件系统,安装 pre-commit 后无法成功 commit,可以尝试逐个文件进行修复。
pre-commit run --files <file_name>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该直接写 float
,float32
不是 Python 原生的数据类型
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:math:`0.0`
这里的数字默认值可以这样写~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
辛苦先合并下上游修改~
@@ -13,12 +13,12 @@ Pad1D | |||
|
|||
- **padding** (Tensor | List[int] | int) - 填充大小。如果是int,则在所有待填充边界使用相同的填充, | |||
否则填充的格式为[pad_left, pad_right]。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **value** (float32, 可选) - 以 ``'constant'`` 模式填充区域时填充的值。默认值为0.0。 | ||
- **data_format** (str, 可选) - 指定输入的format,可为 ``'NCL'`` 或者 ``'NLC'``,默认值为 ``'NCL'``。 | ||
- **name** (str, 可选) - 该参数供开发人员打印调试信息时使用,具体用法请参见 :ref:`api_guide_Name` ,缺省值为None。 | ||
- **value** (float32, 可选) - 以 ``'constant'`` 模式填充区域时填充的值。默认值为0.0。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该直接写 float
,float32
不是 Python 原生的数据类型
- **name** (str, 可选) - 该参数供开发人员打印调试信息时使用,具体用法请参见 :ref:`api_guide_Name` ,缺省值为None。 | ||
- **value** (float32, 可选) - 以 ``'constant'`` 模式填充区域时填充的值。默认值为0.0。 | ||
- **data_format** (str, 可选) - 指定输入的format,可为 ``'NCL'`` 或者 ``'NLC'``,默认值为 ``'NCL'``。 | ||
- **name** (str, 可选) - 该参数供开发人员打印调试信息时使用,具体用法请参见 :ref:`api_guide_Name` ,缺省值为None。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里可以改成这个:
docs/docs/templates/common_docs.py
Line 42 in 6dc68c9
name (str,可选) - 具体用法请参见 :ref:`api_guide_Name` ,一般无需设置,默认值为 None。 |
英文可同步修改为:
docs/docs/templates/common_docs.py
Line 9 in 6dc68c9
name (str, optional): For details, please refer to :ref:`api_guide_Name`. Generally, no setting is required. Default: None. |
可能需要注意 copy 过来后改一下格式~
- **value** (float32, 可选) - 以 ``'constant'`` 模式填充区域时填充的值。默认值为0.0。 | ||
- **data_format** (str, 可选) - 指定输入的format,可为 ``'NCL'`` 或者 ``'NLC'``,默认值为 ``'NCL'``。 | ||
- **name** (str, 可选) - 该参数供开发人员打印调试信息时使用,具体用法请参见 :ref:`api_guide_Name` ,缺省值为None。 | ||
- **value** (float32, 可选) - 以 ``'constant'`` 模式填充区域时填充的值。默认值为0.0。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:math:`0.0`
这里的数字默认值可以这样写~
issue a new PR #5136 instead! |
PADDLEPADDLE_PR=45068