-
Notifications
You must be signed in to change notification settings - Fork 765
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
[SCU][Docathon][Add API Legend No.36]为tensordot API添加图例 #6971
base: develop
Are you sure you want to change the base?
Conversation
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-6971.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html |
docs/api/paddle/tensordot_cn.rst
Outdated
@@ -5,7 +5,13 @@ tensordot | |||
|
|||
.. py:function:: paddle.tensordot(x, y, axes=2, name=None) | |||
|
|||
Tensor 缩并运算(Tensor Contraction),即沿着 axes 给定的多个轴对两个 Tensor 对应元素的乘积进行加和操作。 | |||
Tensor 缩并运算(Tensor Tensordot),即计算的是两个张量在某些轴上的乘积并求和。 |
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.
这句话不用改
docs/api/paddle/tensordot_cn.rst
Outdated
Tensor 缩并运算(Tensor Contraction),即沿着 axes 给定的多个轴对两个 Tensor 对应元素的乘积进行加和操作。 | ||
Tensor 缩并运算(Tensor Tensordot),即计算的是两个张量在某些轴上的乘积并求和。 | ||
可以选择沿一个或多个轴进行点积操作,操作后返回的结果张量维度是 A 和 B 上未参与点积的维度的并集。 | ||
图例中展示了一个shape = [2,2,2]的a张量,和shape = [2,3]的b张量,res为a,b两个张量沿着axis = 1轴做tensordot的结果 |
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.
不是沿着 axis=1 轴
,参考 axes 的参数说明 axes 可以是一个非负整数。若输入的是一个整数 n,则表示对 x 的后 n 个轴和对 y 的前 n 个轴进行缩并运算
,是对 [2,2,2] 的最后一个轴和 [2,3] 的第一个轴进行缩并,最终取得 [2,2,3]
docs/api/paddle/tensordot_cn.rst
Outdated
可以选择沿一个或多个轴进行点积操作,操作后返回的结果张量维度是 A 和 B 上未参与点积的维度的并集。 | ||
图例中展示了一个shape = [2,2,2]的a张量,和shape = [2,3]的b张量,res为a,b两个张量沿着axis = 1轴做tensordot的结果 | ||
res = paddle.tensordot(x, y, axes = 1) | ||
.. image:: ../../images/api_legend/concat.png |
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.
为什么用的 concat?
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.
整个文档改完后注意预览效果,根据预览效果再修改
docs/images/api_legend/tensordot.png
Outdated
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.
- 每个 tensor 标上轴 axis
- 优化一下图以更加清晰
为tensordot API添加图例并修改tensordot_cn.rst
中文文档链接:docs/api/paddle/tensordot_cn.rst
@From00
@sunzhongkai588