-
Notifications
You must be signed in to change notification settings - Fork 673
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
【Hackathon2 No.56 57 58 59 Hackathon3 No.23】add doc of paddle.incubate.sparse.add subtract multiply divide is_same_shape #4705
Merged
zhwesky2010
merged 13 commits into
PaddlePaddle:develop
from
gsq7474741:add_sparse_elwise_op
Sep 9, 2022
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
251f8f4
add doc of paddle.sparse.add subtract multiply divide
gsq7474741 32061f5
add doc of paddle.sparse.add subtract multiply divide
gsq7474741 128140f
add doc of paddle.sparse.add subtract multiply divide
gsq7474741 269999a
move to incubate
gsq7474741 4fa1eeb
Merge branch 'PaddlePaddle:develop' into add_sparse_elwise_op
gsq7474741 572440f
add sparse docs
gsq7474741 a93c90f
fix typo
gsq7474741 9821c5b
fix file name
gsq7474741 2ab17cd
reformatting add_cn.rst
SigureMo 62bea50
reformatting divide_cn.rst
SigureMo 6816855
reformatting multiply_cn.rst
SigureMo 599022b
reformatting subtract_cn.rst
SigureMo de22ba2
reformatting is_same_shape_cn.rst
SigureMo File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
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,36 @@ | ||
.. _cn_api_paddle_incubate_sparse_add: | ||
|
||
add | ||
------------------------------- | ||
|
||
.. py:function:: paddle.incubate.sparse.add(x, y, name=None) | ||
|
||
|
||
|
||
输入 :attr:`x` 与输入 :attr:`y` 逐元素相加,并将各个位置的输出元素保存到返回结果中。 | ||
|
||
输入 :attr:`x` 与输入 :attr:`y` 必须为相同形状且为相同稀疏压缩格式(同为 `SparseCooTensor` 或同为 `SparseCsrTensor`),如果同为 `SparseCooTensor` 则 `sparse_dim` 也需要相同。 | ||
|
||
等式为: | ||
|
||
.. math:: | ||
Out = X + Y | ||
|
||
- :math:`X`:多维稀疏 Tensor。 | ||
- :math:`Y`:多维稀疏 Tensor。 | ||
|
||
参数 | ||
::::::::: | ||
- **x** (Tensor) - 输入的 Tensor,数据类型为 float32、float64、int32 或 int64。 | ||
- **y** (Tensor) - 输入的 Tensor,数据类型为 float32、float64、int32 或 int64。 | ||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
|
||
返回 | ||
::::::::: | ||
多维稀疏 Tensor, 数据类型和压缩格式与 :attr:`x` 相同 。 | ||
|
||
|
||
代码示例 | ||
::::::::: | ||
|
||
COPY-FROM: paddle.incubate.sparse.add |
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,36 @@ | ||
.. _cn_api_paddle_incubate_sparse_divide: | ||
|
||
divide | ||
------------------------------- | ||
|
||
.. py:function:: paddle.incubate.sparse.divide(x, y, name=None) | ||
|
||
|
||
|
||
输入 :attr:`x` 与输入 :attr:`y` 逐元素相除,并将各个位置的输出元素保存到返回结果中。 | ||
|
||
输入 :attr:`x` 与输入 :attr:`y` 必须为相同形状且为相同稀疏压缩格式(同为 `SparseCooTensor` 或同为 `SparseCsrTensor`),如果同为 `SparseCooTensor` 则 `sparse_dim` 也需要相同。 | ||
|
||
等式为: | ||
|
||
.. math:: | ||
Out = X / Y | ||
|
||
- :math:`X`:多维稀疏 Tensor。 | ||
- :math:`Y`:多维稀疏 Tensor。 | ||
|
||
参数 | ||
::::::::: | ||
- **x** (Tensor) - 输入的 Tensor,数据类型为 float32、float64、int32 或 int64。 | ||
- **y** (Tensor) - 输入的 Tensor,数据类型为 float32、float64、int32 或 int64。 | ||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
|
||
返回 | ||
::::::::: | ||
多维稀疏 Tensor, 数据类型和压缩格式与 :attr:`x` 相同,如果是整数相除则返回数据类型为 `float32`。 | ||
|
||
|
||
代码示例 | ||
::::::::: | ||
|
||
COPY-FROM: paddle.incubate.sparse.divide |
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,26 @@ | ||
.. _cn_api_paddle_incubate_sparse_is_same_shape: | ||
|
||
is_same_shape | ||
------------------------------- | ||
|
||
|
||
|
||
.. py:function:: paddle.incubate.sparse.is_same_shape(x, y) | ||
|
||
返回两个 Tensor 形状比较的结果,判断输入 :attr:`x` 与输入 :attr:`y` 的形状是否相同,支持 DenseTensor、SparseCsrTensor 与 SparseCooTensor 之间任意两种的形状比较。 | ||
|
||
参数 | ||
::::::::: | ||
- **x** (Tensor) - 输入的 Tensor,类型为 DenseTensor、SparseCsrTensor 与 SparseCooTensor 之一。 | ||
- **y** (Tensor) - 输入的 Tensor,类型为 DenseTensor、SparseCsrTensor 与 SparseCooTensor 之一。 | ||
|
||
返回 | ||
::::::::: | ||
|
||
bool,两个 Tensor 形状比较的结果,相同为 True,不同为 False。 | ||
|
||
|
||
代码示例 | ||
::::::::: | ||
|
||
COPY-FROM: paddle.incubate.sparse.is_same_shape |
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,36 @@ | ||
.. _cn_api_paddle_incubate_sparse_multiply: | ||
|
||
multiply | ||
------------------------------- | ||
|
||
.. py:function:: paddle.incubate.sparse.multiply(x, y, name=None) | ||
|
||
|
||
|
||
输入 :attr:`x` 与输入 :attr:`y` 逐元素相乘,并将各个位置的输出元素保存到返回结果中。 | ||
|
||
输入 :attr:`x` 与输入 :attr:`y` 必须为相同形状且为相同稀疏压缩格式(同为 `SparseCooTensor` 或同为 `SparseCsrTensor`),如果同为 `SparseCooTensor` 则 `sparse_dim` 也需要相同。 | ||
|
||
等式为: | ||
|
||
.. math:: | ||
Out = X \odot Y | ||
|
||
- :math:`X`:多维稀疏 Tensor。 | ||
- :math:`Y`:多维稀疏 Tensor。 | ||
|
||
参数 | ||
::::::::: | ||
- **x** (Tensor) - 输入的 Tensor,数据类型为 float32、float64、int32 或 int64。 | ||
- **y** (Tensor) - 输入的 Tensor,数据类型为 float32、float64、int32 或 int64。 | ||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
|
||
返回 | ||
::::::::: | ||
多维稀疏 Tensor, 数据类型和压缩格式与 :attr:`x` 相同。 | ||
|
||
|
||
代码示例 | ||
::::::::: | ||
|
||
COPY-FROM: paddle.incubate.sparse.multiply |
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,36 @@ | ||
.. _cn_api_paddle_incubate_sparse_subtract: | ||
|
||
subtract | ||
------------------------------- | ||
|
||
.. py:function:: paddle.incubate.sparse.subtract(x, y, name=None) | ||
|
||
|
||
|
||
输入 :attr:`x` 与输入 :attr:`y` 逐元素相减,并将各个位置的输出元素保存到返回结果中。 | ||
|
||
输入 :attr:`x` 与输入 :attr:`y` 必须为相同形状且为相同稀疏压缩格式(同为 `SparseCooTensor` 或同为 `SparseCsrTensor`),如果同为 `SparseCooTensor` 则 `sparse_dim` 也需要相同。 | ||
|
||
等式为: | ||
|
||
.. math:: | ||
Out = X - Y | ||
|
||
- :math:`X`:多维稀疏 Tensor。 | ||
- :math:`Y`:多维稀疏 Tensor。 | ||
|
||
参数 | ||
::::::::: | ||
- **x** (Tensor) - 输入的 Tensor,数据类型为 float32、float64、int32 或 int64。 | ||
- **y** (Tensor) - 输入的 Tensor,数据类型为 float32、float64、int32 或 int64。 | ||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
|
||
返回 | ||
::::::::: | ||
多维稀疏 Tensor, 数据类型和压缩格式与 :attr:`x` 相同 。 | ||
|
||
|
||
代码示例 | ||
::::::::: | ||
|
||
COPY-FROM: paddle.incubate.sparse.subtract |
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.
这里最好和英文是一致的,现在英文貌似少一些内容~