Skip to content
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

添加sparse相关文档 #5208

Merged
merged 4 commits into from
Sep 2, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/api/paddle/Overview_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -404,5 +404,5 @@ device 相关
:header: "API 名称", "API 功能"
:widths: 10, 30

" :ref:`paddle.sparse.sparse_coo_tensor<cn_api_paddle_sparse_coo_tensor>` ", "创建一个 COO(Coordinate)格式的稀疏 Tensor"
" :ref:`paddle.sparse.sparse_csr_tensor<cn_api_paddle_sparse_csr_tensor>` ", "创建一个 CSR(Compressed Sparse Row)格式的稀疏 Tensor"
" :ref:`paddle.incubate.sparse.sparse_coo_tensor<cn_api_paddle_incubate_sparse_coo_tensor>` ", "创建一个 COO(Coordinate)格式的稀疏 Tensor"
" :ref:`paddle.incubate.sparse.sparse_csr_tensor<cn_api_paddle_incubate_sparse_csr_tensor>` ", "创建一个 CSR(Compressed Sparse Row)格式的稀疏 Tensor"
49 changes: 49 additions & 0 deletions docs/api/paddle/incubate/sparse/Overview_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
.. _cn_overview_paddle:

paddle.incubate.sparse
---------------------

paddle.incubate.sparse 目录包含飞桨框架支持稀疏数据存储和计算相关的API。具体如下:

- :ref:`稀疏数据结构相关 <about_sparse_tensor>`
- :ref:`数学操作API <about_sparse_math>`
- :ref:`NN相关API <about_sparse_nn>`

.. _about_sparse_tensor:

稀疏数据结构相关
::::::::::::::::::::

.. csv-table::
:header: "API 名称", "API 功能"

" :ref:`paddle.incubate.sparse.sparse_coo_tensor <cn_api_paddle_incubate_sparse_coo_tensor>` ", "构造COO格式的SparseTensor"
" :ref:`paddle.incubate.sparse.sparse_csr_tensor <cn_api_paddle_incubate_sparse_csr_tensor>` ", "构造CSR格式的SparseTensor"


.. _about_sparse_math:

数学操作相关
::::::::::::::::::::

.. csv-table::
:header: "API 名称", "API 功能"

" :ref:`paddle.incubate.sparse.abs` ", "绝对值函数"
" :ref:`paddle.incubate.sparse.add` ", "Sparse Tensor逐元素相加"
" :ref:`paddle.incubate.sparse.asin` ", "arcsine函数"
" :ref:`paddle.incubate.sparse.asinh` ", "反双曲正弦函数"
" :ref:`paddle.incubate.sparse.atan` ", "反双曲正切函数"


.. _about_sparse_nn:

NN相关
::::::::::::::::::::

.. csv-table::
:header: "API 名称", "API 功能"

" :ref:`paddle.incubate.sparse.nn.Conv3D` ", "三维卷积"
" :ref:`paddle.incubate.sparse.nn.SubmConv3D` ", "三维的submanifold卷积"
" :ref:`paddle.incubate.sparse.nn.Relu` ", "激活函数"
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.. _cn_api_paddle_sparse_coo_tensor:
.. _cn_api_paddle_incubate_sparse_coo_tensor:

sparse_coo_tensor
-------------------------------


.. py:function:: paddle.sparse.sparse_coo_tensor(indices, values, shape=None, dtype=None, place=None, stop_gradient=True)
.. py:function:: paddle.incubate.sparse.sparse_coo_tensor(indices, values, shape=None, dtype=None, place=None, stop_gradient=True)

该 API 通过已知的非零元素的 ``indices`` 和 ``values`` 来创建一个 coordinate 格式的稀疏 tensor,tensor 类型为 ``paddle.Tensor`` 。

Expand Down Expand Up @@ -40,4 +40,4 @@ sparse_coo_tensor
代码示例
:::::::::

COPY-FROM: paddle.sparse.sparse_coo_tensor
COPY-FROM: paddle.incubate.sparse.sparse_coo_tensor
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.. _cn_api_paddle_sparse_csr_tensor:
.. _cn_api_paddle_incubate_sparse_csr_tensor:

sparse_csr_tensor
-------------------------------


.. py:function:: paddle.sparse.sparse_csr_tensor(crows, cols, values, shape, dtype=None, place=None, stop_gradient=True)
.. py:function:: paddle.incubate.sparse.sparse_csr_tensor(crows, cols, values, shape, dtype=None, place=None, stop_gradient=True)

该 API 通过已知的非零元素的 ``crows`` , ``cols`` 和 ``values`` 来创建一个 CSR(Compressed Sparse Row) 格式的稀疏 tensor,tensor 类型为 ``paddle.Tensor`` 。

Expand Down Expand Up @@ -43,4 +43,4 @@ sparse_csr_tensor

**代码示例**

COPY-FROM: paddle.sparse.sparse_csr_tensor
COPY-FROM: paddle.incubate.sparse.sparse_csr_tensor