-
Notifications
You must be signed in to change notification settings - Fork 762
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
update paddle.nn.Pad1D/2D/3D cn docs #5136
Changes from 3 commits
3061b83
b2ff037
68b1879
81224e1
85aeaa7
77f6b75
798415a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,26 +12,23 @@ pad | |
参数 | ||
:::::::::::: | ||
|
||
- **x** (Tensor) - Tensor,format 可以为 ``'NCL'``, ``'NLC'``, ``'NCHW'``, ``'NHWC'``, ``'NCDHW'`` | ||
或 ``'NDHWC'``,默认值为 ``'NCHW'``,数据类型支持 float16, float32, float64, int32, int64。 | ||
- **pad** (Tensor | List[int] | Tuple[int]) - 填充大小。如果 ``mode`` 为 ``'constant'``,并且 ``pad`` 的长度为 ``x`` 维度的 2 倍时, | ||
则会根据 ``pad`` 和 ``value`` 对 ``x`` 从前面的维度向后依次补齐;否则:1。当输入维度为 3 时,pad 的格式为[pad_left, pad_right]; | ||
2. 当输入维度为 4 时,pad 的格式为[pad_left, pad_right, pad_top, pad_bottom]; | ||
3. 当输入维度为 5 时,pad 的格式为[pad_left, pad_right, pad_top, pad_bottom, pad_front, pad_back]。 | ||
- **mode** (str,可选) - padding 的四种模式,分别为 ``'constant'``, ``'reflect'``, ``'replicate'`` 和 ``'circular'``。 | ||
``'constant'`` 表示填充常数 ``value``; ``'reflect'`` 表示填充以 ``x`` 边界值为轴的映射;``'replicate'`` 表示 | ||
填充 ``x`` 边界值;``'circular'`` 为循环填充 ``x``。具体结果可见以下示例。默认值为 ``'constant'``。 | ||
- **value** (float32,可选) - 以 ``'constant'`` 模式填充区域时填充的值。默认值为 0.0。 | ||
- **data_format** (str,可选) - 指定 ``x`` 的 format,可为 ``'NCL'``, ``'NLC'``, ``'NCHW'``, ``'NHWC'``, ``'NCDHW'`` | ||
或 ``'NDHWC'``,默认值为 ``'NCHW'``。 | ||
- **x** (Tensor) - Tensor,format 可以为 ``'NCL'``、 ``'NLC'``、 ``'NCHW'``、 ``'NHWC'``、 ``'NCDHW'``或 ``'NDHWC'``,默认值为 ``'NCHW'``,数据类型支持 float16, float32, float64, int32, int64。 | ||
- **pad** (Tensor|list[int]|tuple[int]) - 填充大小。如果 ``mode`` 为 ``'constant'``,并且 ``pad`` 的长度为 ``x`` 维度的 2 倍时,则会根据 ``pad`` 和 ``value`` 对 ``x`` 从前面的维度向后依次补齐;否则: | ||
- 当输入维度为 3 时,pad 的格式为[pad_left, pad_right]; | ||
- 当输入维度为 4 时,pad 的格式为[pad_left, pad_right, pad_top, pad_bottom]; | ||
- 当输入维度为 5 时,pad 的格式为[pad_left, pad_right, pad_top, pad_bottom, pad_front, pad_back]。 | ||
- **mode** (str,可选) - padding 的四种模式,分别为 ``'constant'``、 ``'reflect'``、 ``'replicate'`` 和 ``'circular'``,默认值为 ``'constant'``。 | ||
- ``'constant'`` 表示填充常数 ``value``; | ||
- ``'reflect'`` 表示填充以 ``x`` 边界值为轴的映射; | ||
- ``'replicate'`` 表示填充 ``x`` 边界值; | ||
- ``'circular'`` 为循环填充 ``x``。具体结果可见以下示例。 | ||
- **value** (float32,可选) - 以 ``'constant'`` 模式填充区域时填充的值。默认值为:math:`0.0`。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. 这里的 |
||
- **data_format** (str,可选) - 指定 ``x`` 的数据格式,可为 ``'NCL'``, ``'NLC'``, ``'NCHW'``, ``'NHWC'``, ``'NCDHW'``或 ``'NDHWC'``,默认值为 ``'NCHW'``。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里的可选值也应该是用 另外,中文标点符号和中英文之间不需要加空格,所以 |
||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
返回 | ||
:::::::::::: | ||
Tensor,对 ``x`` 进行 ``'pad'`` 的结果,数据类型和 ``x`` 相同。 | ||
|
||
返回类型 | ||
|
||
|
||
|
||
**示例**: | ||
|
||
|
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.
这里列表还是有问题,需要空行:
这里它将紧贴着的渲染成了
<dl>
,可参考 https://zh-sphinx-doc.readthedocs.io/en/latest/rest.html#id18 ,这里有说「列表可以嵌套,但是需跟父列表使用空行分隔」,所以可能需要写成这样:非常抱歉并不是很熟悉嵌套列表,所以之前有点误导