-
Notifications
You must be signed in to change notification settings - Fork 724
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
[Docathon][Add CN Doc No.4-5] #6362
Merged
Merged
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6108480
add docs
zade23 85f0508
Update docs/api/paddle/incubate/nn/functional/fused_matmul_bias_cn.rst
zade23 c66f188
Merge branch 'PaddlePaddle:develop' into den_doc_45
zade23 afbfd15
Update FusedLinear_cn.rst
zade23 0720218
Update fused_matmul_bias_cn.rst
zade23 125fe2d
Update fused_matmul_bias_cn.rst
zade23 870912d
Merge branch 'PaddlePaddle:develop' into den_doc_45
zade23 b28b23a
Merge branch 'PaddlePaddle:develop' into den_doc_45
zade23 7ffa072
Update FusedLinear_cn.rst
zade23 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 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,45 @@ | ||
.. _cn_api_paddle_incubate_nn_FusedLinear: | ||
|
||
FusedLinear | ||
------------------------------- | ||
|
||
.. py:class:: paddle.incubate.nn.FusedLinear(in_features, out_features, weight_attr=None, bias_attr=None, transpose_weight=False, name=None) | ||
|
||
线性层仅接受一个多维张量作为输入,其形状为 :math:`[batch\_size, *, in\_features]`,其中 :math:`*` 表示任意数量的额外维度。 | ||
|
||
它将输入张量与权重(形状为 :math:`[in\_features, out\_features]` 的二维张量)相乘,产生形状为 :math:`[batch\_size, *, out\_features]` 的输出张量。 | ||
|
||
如果 :math:`bias\_attr` 不为 False,则将创建偏置(形状为 :math:`[out\_features]` 的一维张量)并加到输出上。 | ||
|
||
参数 | ||
:::::::::::: | ||
- **in_features** (int) - 输入单元的数量。 | ||
- **out_features** (int) - 输出单元的数量。 | ||
- **weight_attr** (ParamAttr,可选) - 指定权重参数属性的对象。默认值:``None``,表示使用默认的权重参数属性,即使用 0 进行初始化。具体用法请参见 :ref:`cn_api_paddle_ParamAttr` 。 | ||
- **transpose_weight** (bool) - 在乘法前是否转置 `weight` 张量。 | ||
- **bias_attr** (ParamAttr|bool,可选) - 指定偏置参数属性的对象。如果该参数值是 ``ParamAttr``,则使用 ``ParamAttr``。如果该参数为 ``bool`` 类型,只支持为 ``False``,表示没有偏置参数。默认值为 None,表示使用默认的偏置参数属性。具体用法请参见 :ref:`cn_api_paddle_ParamAttr` 。 | ||
- **name** (str,可选) - 通常用户无需设置此参数。有关详细信息,请参阅 :ref:`api_guide_Name`。 | ||
|
||
属性 | ||
:::::::::::: | ||
- **weight** (Parameter) - 本层的可学习权重。 | ||
- **bias** (Parameter) - 本层的可学习偏置。 | ||
|
||
形状 | ||
:::::::::::: | ||
- 输入:形状为 :math:`[batch\_size, *, in\_features]` 的多维张量。 | ||
- 输出:形状为 :math:`[batch\_size, *, out\_features]` 的多维张量。 | ||
|
||
代码示例 | ||
::::::::: | ||
|
||
COPY-FROM: paddle.incubate.nn.FusedLinear | ||
|
||
forward(input) | ||
:::::::::::: | ||
定义每次调用时执行的计算。应由所有子类覆盖。 | ||
|
||
参数 | ||
:::::::::::: | ||
- **inputs** (tuple) - 解压缩的元组参数。 | ||
- **kwargs** (dict) - 解压缩的字典参数。 |
28 changes: 28 additions & 0 deletions
28
docs/api/paddle/incubate/nn/functional/fused_matmul_bias_cn.rst
This file contains 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,28 @@ | ||
.. _cn_api_paddle_incubate_nn_functional_fused_matmul_bias: | ||
|
||
fused_matmul_bias | ||
------------------------------- | ||
|
||
.. py:function:: paddle.incubate.nn.functional.fused_matmul_bias(x, y, bias=None, transpose_x=False, transpose_y=False, name=None) | ||
|
||
应用两个张量的矩阵乘法,然后如果提供了偏置,进行偏置加法。 | ||
|
||
此方法要求 CUDA 版本不低于 11.6。 | ||
|
||
参数 | ||
:::::::::::: | ||
- **x** (Tensor) - 第一个输入 ``Tensor``,被乘 ``Tensor``。 | ||
- **y** (Tensor) - 第二个输入 ``Tensor``,被乘 ``Tensor``。其秩必须为 2。 | ||
- **bias** (Tensor,可选) - 输入的偏置。如果为 None,则不执行偏置加法。否则,偏置将被加到矩阵乘法结果上。默认:None。 | ||
- **transpose_x** (bool,可选) - 是否在乘法前转置 :math:`x`。默认:False。 | ||
- **transpose_y** (bool,可选) - 是否在乘法前转置 :math:`y`。默认:False。 | ||
- **name** (str,可选) - 具体信息请参阅 :ref:`api_guide_Name`。通常无需设置名称,默认为 None。 | ||
|
||
返回 | ||
:::::::::::: | ||
输出 ``Tensor`` | ||
|
||
代码示例 | ||
:::::::::::: | ||
|
||
COPY-FROM: paddle.incubate.nn.functional.fused_matmul_bias |
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.
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.
请直接参考
https://github.com/PaddlePaddle/docs/blob/develop/docs/api/paddle/nn/Linear_cn.rst
书写,内容里还有不少可以改进的地方。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.
已修改。参考
Linear_cn.rst
的内容和格式。