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

Add sparse api chinese doc #5362

Merged
merged 3 commits into from
Oct 18, 2022
Merged

Conversation

zhwesky2010
Copy link
Collaborator

@zhwesky2010 zhwesky2010 commented Oct 14, 2022

批量新增稀疏API的中文文档

@paddle-bot
Copy link

paddle-bot bot commented Oct 14, 2022

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-5362.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html
预览工具的更多说明,请参考:[Beta]飞桨文档预览工具

@zhwesky2010 zhwesky2010 force-pushed the sparse_doc branch 3 times, most recently from 704b496 to e8bce70 Compare October 14, 2022 15:23
" :ref:`paddle.incubate.sparse.nn.Relu` ", "激活函数"
" :ref:`paddle.incubate.sparse.nn.functional.conv3d ` ", "三维卷积函数"
" :ref:`paddle.incubate.sparse.nn.functional.subm_conv3d ` ", "三维的 submanifold 卷积函数"
" :ref:`paddle.incubate.sparse.nn.functional.max_pool3d ` ", "三维最大池化层"
Copy link
Collaborator

@momozi1996 momozi1996 Oct 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

绝对链接有问题:
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这5个文档的PR后面开活会提交,这里只提交一个模板

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

" :ref:`paddle.incubate.sparse.nn.ReLU <cn_api_paddle_incubate_sparse_nn_ReLU>` ", "激活层"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请检查绝对链接,预览未生成
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,因为链接现在失效的,所以如果现在合入,后期还是需再修改的。 还是等待有绝对链接再合入,OK么?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,因为链接现在失效的,所以如果现在合入,后期还是需再修改的。 还是等待有绝对链接再合入,OK么?

已经删掉了,还是不要被阻塞了

" :ref:`paddle.incubate.sparse.multiply <cn_api_paddle_incubate_sparse_multiply>` ", "对稀疏 Tensor 逐元素相乘"
" :ref:`paddle.incubate.sparse.divide <cn_api_paddle_incubate_sparse_divide>` ", "对稀疏 Tensor 逐元素相除"
" :ref:`paddle.incubate.sparse.transpose <cn_api_paddle_incubate_sparse_transpose>` ", "对稀疏 Tensor 根据 perm 进行数据重排"
" :ref:`paddle.incubate.sparse.coalesce ` ", "对 SparseCooTensor 进行排序与合并操作"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

绝对链接的问题
image

Copy link
Collaborator Author

@zhwesky2010 zhwesky2010 Oct 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上,这几个已删除

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]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

公式是否有问题?
image

Copy link
Collaborator Author

@zhwesky2010 zhwesky2010 Oct 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修复

输入、输出的格式对应关系如下:

.. note::
x[DenseTensor] @ y[DenseTensor] * mask[SparseCooTensor] -> out[SparseCooTensor]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里有问题不?
image

Copy link
Collaborator Author

@zhwesky2010 zhwesky2010 Oct 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修复

输入、输出的格式对应关系如下:

.. note::
x[SparseCsrTensor] @ y[SparseCsrTensor] -> out[SparseCsrTensor]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Collaborator Author

@zhwesky2010 zhwesky2010 Oct 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修复


.. note::
x[SparseCsrTensor] @ vec[DenseTensor] -> out[DenseTensor]
x[SparseCooTensor] @ vec[DenseTensor] -> out[DenseTensor]
Copy link
Collaborator

@momozi1996 momozi1996 Oct 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修复

:::::::::
- input:任意形状的 SparseTensor。
- output:和 input 具有相同形状和数据类型的 SparseTensor。

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1)返回值?

2)class类的所有用法,需要写一下。参考别的class类

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1)这个是class类的,没有返回值。

2)没有其他用法,看了下别的激活类class,也是这样的写法

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

代码示例
:::::::::

COPY-FROM: paddle.incubate.sparse.transpose
Copy link
Collaborator

@momozi1996 momozi1996 Oct 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

COPY-FROM未生成代码块,可能是英文文档有错误或警告

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

transpose是最新和入的,应该是所安装的whl包里还没有这个api的问题,这一行和其他写法是一样的

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

写法是一样的,因为别的API 从英文文档和源代码拷贝成功了,不过transpose没有拷贝成功。
应该是transpose的英文文档有CI没过。

这个示例代码是需要正确的,否则无法合入

Copy link
Collaborator Author

@zhwesky2010 zhwesky2010 Oct 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已经删除

Copy link
Collaborator

@momozi1996 momozi1996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一些小问题,注意,链接+示例代码+返回值的问题属于红线,优先解决一下~ 辛苦了

@zhwesky2010
Copy link
Collaborator Author

zhwesky2010 commented Oct 17, 2022

一些小问题,注意,链接+示例代码+返回值的问题属于红线,优先解决一下~ 辛苦了

有问题地方都已经删掉了,目前没问题了,发版PR需要尽快合入

@zhwesky2010 zhwesky2010 changed the title Add many sparse api chinese doc Add sparse api chinese doc Oct 17, 2022
Copy link
Collaborator

@momozi1996 momozi1996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhwesky2010 zhwesky2010 merged commit ff29179 into PaddlePaddle:develop Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants