- Notifications
You must be signed in to change notification settings - Fork 874
【Hackathon 6th No.3】为 Paddle 新增 ZeroPad1D / ZeroPad3D / block_diag API #6651
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits Select commit Hold shift + click to select a range
2be49cc ZeroPad1D and ZeroPad3D and block_diag docs
ADream-ki 6247a98 update
ADream-ki 6bdac27 Merge branch 'develop' into task2
ADream-ki ffec120 update
ADream-ki 55ecdf9 Merge branch 'task2' of https://github.com/Chen-Lun-Hao/docs into task2
ADream-ki 93fabf3 finish
ADream-ki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
sunzhongkai588 marked this conversation as resolved. Show resolved Hide resolved |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| .. _cn_api_paddle_block_diag: | ||
| | ||
| block_diag | ||
| ------------------------------- | ||
| | ||
| .. py:function:: paddle.block_diag(inputs, name=None) | ||
| | ||
| 根据 `inputs` 创建对角矩阵。 | ||
| | ||
| 参数 | ||
| ::::::::: | ||
| - **inputs** (list|tuple) - 是一个 Tensor 列表或 Tensor 元组,其子项为0、1、2维的 Tensor 。数据类型为: `bool`、 `float16`、 `float32`、 `float64`、 `uint8`、 `int8`、 `int16`、 `int32`、 `int64`、 `bfloat16`、 `complex64`、 `complex128`。 | ||
sunzhongkai588 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| - **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 `None`。 | ||
| | ||
| 返回 | ||
| ::::::::: | ||
| | ||
| Tensor, 与 ``inputs`` 数据类型相同。 | ||
| | ||
| 代码示例 | ||
| ::::::::: | ||
| | ||
| COPY-FROM: paddle.block_diag | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
sunzhongkai588 marked this conversation as resolved. Show resolved Hide resolved |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| .. _cn_api_paddle_nn_ZeroPad1D: | ||
| | ||
| ZeroPad1D | ||
| ------------------------------- | ||
| .. py:class:: paddle.nn.ZeroPad1D(padding, data_format="NCL", name=None) | ||
| | ||
| **ZeroPad1D** | ||
| | ||
| 按照 padding 属性对输入进行零填充。 | ||
| | ||
| 参数 | ||
| ::::::::: | ||
| | ||
| - **padding** (Tensor | List[int] | int) - 如果输入数据类型为 int,则在所有待填充边界使用相同的填充, | ||
ADream-ki marked this conversation as resolved. Show resolved Hide resolved | ||
| 否则填充的格式为[pad_left, pad_right]。 | ||
| - **data_format** (str) - 指定输入的 format,可为 ``'NCL'`` 或者 ``'NLC'``,默认值为 ``'NCL'``,其中 `N` 是 batch size, `C` 是通道数, `L` 输入特征的长度。 | ||
| - **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
| | ||
| 返回 | ||
| :::::::::::: | ||
| 无 | ||
| | ||
| 形状 | ||
| ::::::::: | ||
| | ||
| - x(Tensor): ZeroPadD 层的输入,要求形状为 3-D,dtype 为 ``'float32'`` 或 ``'float64'`` | ||
| - output(Tensor):输出,形状为 3-D,dtype 与 ``'input'`` 相同 | ||
| | ||
| 代码示例 | ||
| ::::::::: | ||
| | ||
| COPY-FROM: paddle.nn.ZeroPad1D | ||
sunzhongkai588 marked this conversation as resolved. Show resolved Hide resolved |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| .. _cn_api_paddle_nn_ZeroPad3D: | ||
| | ||
| ZeroPad3D | ||
| ------------------------------- | ||
| .. py:class:: paddle.nn.ZeroPad3D(padding, data_format="NCDHW", name=None) | ||
| | ||
| **ZeroPad3D** | ||
| | ||
| 按照 padding 属性对输入进行零填充。 | ||
| | ||
| 参数 | ||
| ::::::::: | ||
| | ||
| - **padding** (Tensor | List[int] | int) - 如果输入数据类型为 int,则在所有待填充边界使用相同的填充, | ||
ADream-ki marked this conversation as resolved. Show resolved Hide resolved | ||
| 否则填充的格式为[pad_left, pad_right, pad_top, pad_bottom, pad_front, pad_back]。 | ||
| - **data_format** (str,可选) - 指定输入的 format,可为 ``'NCDHW'`` 或者 ``'NDHWC'``,默认值为 ``'NCDHW'``,其中 `N` 是批尺寸, `C` 是通道数, `D` 是特征层深度, `H` 是特征层高度, `W` 是特征层宽度。。 | ||
| - **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
| | ||
| 返回 | ||
| :::::::::::: | ||
| 无 | ||
| | ||
| 形状 | ||
| ::::::::: | ||
| | ||
| - x(Tensor): ZeroPadD 层的输入,要求形状为 5-D,dtype 为 ``'float32'`` 或 ``'float64'`` | ||
| - output(Tensor):输出,形状为 5-D,dtype 与 ``'input'`` 相同 | ||
| | ||
| 代码示例 | ||
| ::::::::: | ||
| | ||
| COPY-FROM: paddle.nn.ZeroPad3D | ||
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.