-
Notifications
You must be signed in to change notification settings - Fork 758
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
[Docathon][Add API Legend No.2] #6941
base: develop
Are you sure you want to change the base?
Conversation
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-6941.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html |
@@ -13,6 +13,12 @@ broadcast_tensors | |||
|
|||
.. _Tensor 介绍: ../../guides/beginner/tensor_cn.html#id7 | |||
|
|||
下图展示将三个 Tensor 广播到同一维度的过程。三个 Tensor 的尺寸分别为 [4, 1, 3]、[2, 3]、[4, 2, 1],在广播时,会从最后一个维度开始对齐,对于每一个维度,任意两个 Tensor 的在该维度大小相等;或者其中一个 Tensor 的维度等于 1;或者其中一个 Tensor 的维度不存在。在下图中,最后一个维度中,Tenser3 取值为 1,Tensor1 和 Tensor2 取值为 3,所有 Tensor 的该维度被扩张为3;倒数第二个维度中,Tenser1 取值为 2,Tensor2 和 Tensor3 取值为 2,所有 Tensor 的该维度被扩张为2;倒数第三个维度中,Tenser2 为空,Tensor1 和 Tensor3 取值为 4,所有 Tensor 的该维度被扩张为4。最终,所有 Tensor 都被扩张到 [4, 2, 3]。 |
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.
文字可以稍微精简一下,可以直接说原shape是多少,广播后都成了多少,具某一维度的例子,具体细节参考 Tensor 的广播机制
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.
其实,这段文字主要想表述,他们从后往前对齐,所以再删可能表达不清楚了。
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.
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.
会增加,会复制一份的。
@sunzhongkai588 @JiabinYang