-
Notifications
You must be signed in to change notification settings - Fork 724
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add many sparse api chinese doc * fix comment
- Loading branch information
1 parent
dba0dad
commit ff29179
Showing
41 changed files
with
1,023 additions
and
46 deletions.
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ deg2rad | |
|
||
.. py:function:: paddle.deg2rad(x, name=None) | ||
将元素从弧度的角度转换为度 | ||
将元素从度转换为弧度 | ||
|
||
.. math:: | ||
|
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,29 @@ | ||
.. _cn_api_paddle_incubate_sparse_abs: | ||
|
||
abs | ||
------------------------------- | ||
|
||
.. py:function:: paddle.incubate.sparse.abs(x, name=None) | ||
逐元素计算输入 :attr:`x` 的绝对值,要求 输入 :attr:`x` 为 `SparseCooTensor` 或 `SparseCsrTensor` 。 | ||
|
||
数学公式: | ||
|
||
.. math:: | ||
out = |x| | ||
参数 | ||
::::::::: | ||
- **x** (SparseTensor) - 输入的稀疏 Tensor,可以为 Coo 或 Csr 格式,数据类型为 float32、float64。 | ||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
|
||
返回 | ||
::::::::: | ||
多维稀疏 Tensor, 数据类型和稀疏格式与 :attr:`x` 相同 。 | ||
|
||
|
||
代码示例 | ||
::::::::: | ||
|
||
COPY-FROM: paddle.incubate.sparse.abs |
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,49 @@ | ||
.. _cn_api_paddle_incubate_sparse_addmm: | ||
|
||
addmm | ||
------------------------------- | ||
|
||
.. py:function:: paddle.incubate.sparse.addmm(input, x, y, beta=1.0, alpha=1.0, name=None) | ||
.. note:: | ||
该 API 从 `CUDA 11.0` 开始支持。 | ||
|
||
对输入 :attr:`x` 与输入 :attr:`y` 求稀疏矩阵乘法,并将 `input` 加到计算结果上。 | ||
|
||
数学公式: | ||
|
||
.. math:: | ||
out = alpha * x * y + beta * input | ||
输入、输出的格式对应关系如下: | ||
|
||
.. note:: | ||
|
||
input[SparseCsrTensor] + x[SparseCsrTensor] @ y[SparseCsrTensor] -> out[SparseCsrTensor] | ||
|
||
input[DenseTensor] + x[SparseCsrTensor] @ y[DenseTensor] -> out[DenseTensor] | ||
|
||
input[SparseCooTensor] + x[SparseCooTensor] @ y[SparseCooTensor] -> out[SparseCooTensor] | ||
|
||
input[DenseTensor] + x[SparseCooTensor] @ y[DenseTensor] -> out[DenseTensor] | ||
|
||
该 API 支持反向传播,`input` 、 `x` 、 `y` 的维度相同且>=2D,不支持自动广播。 | ||
|
||
参数 | ||
::::::::: | ||
- **input** (SparseTensor|DenseTensor) - 输入 Tensor,可以为 Coo 或 Csr 格式 或 DenseTensor。数据类型为 float32、float64。 | ||
- **x** (SparseTensor) - 输入 Tensor,可以为 Coo 或 Csr 格式。数据类型为 float32、float64。 | ||
- **y** (SparseTensor|DenseTensor) - 输入 Tensor,可以为 Coo 或 Csr 格式 或 DenseTensor。数据类型为 float32、float64。 | ||
- **beta** (float, 可选) - `input` 的系数。默认:1.0。 | ||
- **alpha** (float, 可选) - `x * y` 的系数。默认:1.0。 | ||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
|
||
返回 | ||
::::::::: | ||
SparseTensor|DenseTensor: 其 Tensor 类型、dtype、shape 与 `input` 相同。 | ||
|
||
|
||
代码示例 | ||
::::::::: | ||
|
||
COPY-FROM: paddle.incubate.sparse.addmm |
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,29 @@ | ||
.. _cn_api_paddle_incubate_sparse_asin: | ||
|
||
asin | ||
------------------------------- | ||
|
||
.. py:function:: paddle.incubate.sparse.asin(x, name=None) | ||
逐元素计算输入 :attr:`x` 的反正弦,要求 输入 :attr:`x` 为 `SparseCooTensor` 或 `SparseCsrTensor` 。 | ||
|
||
数学公式: | ||
|
||
.. math:: | ||
out = asin(x) | ||
参数 | ||
::::::::: | ||
- **x** (SparseTensor) - 输入的稀疏 Tensor,可以为 Coo 或 Csr 格式,数据类型为 float32、float64。 | ||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
|
||
返回 | ||
::::::::: | ||
多维稀疏 Tensor, 数据类型和稀疏格式与 :attr:`x` 相同 。 | ||
|
||
|
||
代码示例 | ||
::::::::: | ||
|
||
COPY-FROM: paddle.incubate.sparse.asin |
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,29 @@ | ||
.. _cn_api_paddle_incubate_sparse_asinh: | ||
|
||
asinh | ||
------------------------------- | ||
|
||
.. py:function:: paddle.incubate.sparse.asinh(x, name=None) | ||
逐元素计算输入 :attr:`x` 的反双曲正弦,要求 输入 :attr:`x` 为 `SparseCooTensor` 或 `SparseCsrTensor` 。 | ||
|
||
数学公式: | ||
|
||
.. math:: | ||
out = asinh(x) | ||
参数 | ||
::::::::: | ||
- **x** (SparseTensor) - 输入的稀疏 Tensor,可以为 Coo 或 Csr 格式,数据类型为 float32、float64。 | ||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
|
||
返回 | ||
::::::::: | ||
多维稀疏 Tensor, 数据类型和稀疏格式与 :attr:`x` 相同 。 | ||
|
||
|
||
代码示例 | ||
::::::::: | ||
|
||
COPY-FROM: paddle.incubate.sparse.asinh |
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,29 @@ | ||
.. _cn_api_paddle_incubate_sparse_atan: | ||
|
||
atan | ||
------------------------------- | ||
|
||
.. py:function:: paddle.incubate.sparse.atan(x, name=None) | ||
逐元素计算输入 :attr:`x` 的反正切,要求 输入 :attr:`x` 为 `SparseCooTensor` 或 `SparseCsrTensor` 。 | ||
|
||
数学公式: | ||
|
||
.. math:: | ||
out = atan(x) | ||
参数 | ||
::::::::: | ||
- **x** (SparseTensor) - 输入的稀疏 Tensor,可以为 Coo 或 Csr 格式,数据类型为 float32、float64。 | ||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
|
||
返回 | ||
::::::::: | ||
多维稀疏 Tensor, 数据类型和稀疏格式与 :attr:`x` 相同 。 | ||
|
||
|
||
代码示例 | ||
::::::::: | ||
|
||
COPY-FROM: paddle.incubate.sparse.atan |
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,29 @@ | ||
.. _cn_api_paddle_incubate_sparse_atanh: | ||
|
||
atanh | ||
------------------------------- | ||
|
||
.. py:function:: paddle.incubate.sparse.atanh(x, name=None) | ||
逐元素计算输入 :attr:`x` 的反双曲正切,要求 输入 :attr:`x` 为 `SparseCooTensor` 或 `SparseCsrTensor` 。 | ||
|
||
数学公式: | ||
|
||
.. math:: | ||
out = atanh(x) | ||
参数 | ||
::::::::: | ||
- **x** (SparseTensor) - 输入的稀疏 Tensor,可以为 Coo 或 Csr 格式,数据类型为 float32、float64。 | ||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
|
||
返回 | ||
::::::::: | ||
多维稀疏 Tensor, 数据类型和稀疏格式与 :attr:`x` 相同 。 | ||
|
||
|
||
代码示例 | ||
::::::::: | ||
|
||
COPY-FROM: paddle.incubate.sparse.atanh |
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_cast: | ||
|
||
cast | ||
------------------------------- | ||
|
||
.. py:function:: paddle.incubate.sparse.cast(x, index_dtype=None, value_dtype=None, name=None) | ||
输入 :attr:`x` 为 `SparseCooTensor` 或 `SparseCsrTensor` 。将稀疏 Tensor 的 index 转换为 `index_dtype` 类型 | ||
( `SparseCsrTensor` 的 index 指: `crows` 与 `col` ),value 转换为 `value_dtype` 类型, | ||
|
||
参数 | ||
::::::::: | ||
- **x** (SparseTensor) - 输入的稀疏 Tensor,可以为 Coo 或 Csr 格式,数据类型为 float32、float64。 | ||
- **index_dtype** (np.dtype|str, optional) - SparseCooTensor 的 index 类型,SparseCsrTensor 的 crows/cols 类型。可以是 uint8,int8,int16,int32,int64。 | ||
- **value_dtype** (np.dtype|str, optional) - SparseCooTensor 或 SparseCsrTensor 的 value 类型。可以是 uint8,int8,int16,int32,int64。 | ||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
|
||
返回 | ||
::::::::: | ||
多维稀疏 Tensor,稀疏格式与 :attr:`x` 相同,数据类型为被转换后的类型。 | ||
|
||
|
||
代码示例 | ||
::::::::: | ||
|
||
COPY-FROM: paddle.incubate.sparse.cast |
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,29 @@ | ||
.. _cn_api_paddle_incubate_sparse_deg2rad: | ||
|
||
deg2rad | ||
------------------------------- | ||
|
||
.. py:function:: paddle.incubate.sparse.deg2rad(x, name=None) | ||
逐元素将输入 :attr:`x` 从度转换为弧度,要求 输入 :attr:`x` 为 `SparseCooTensor` 或 `SparseCsrTensor` 。 | ||
|
||
数学公式: | ||
|
||
.. math:: | ||
deg2rad(x) = \pi * x / 180 | ||
参数 | ||
::::::::: | ||
- **x** (SparseTensor) - 输入的稀疏 Tensor,可以为 Coo 或 Csr 格式,数据类型为 float32、float64。 | ||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
|
||
返回 | ||
::::::::: | ||
多维稀疏 Tensor, 数据类型和稀疏格式与 :attr:`x` 相同 。 | ||
|
||
|
||
代码示例 | ||
::::::::: | ||
|
||
COPY-FROM: paddle.incubate.sparse.deg2rad |
Oops, something went wrong.