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

[Docathon][Add API Legend No.51] add a figure of unfold method and update unfold_cn.rst #6951

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

zeroader
Copy link

Copy link

paddle-bot bot commented Nov 12, 2024

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

:width: 700
:alt: 图例

额外的,当需要在多个位置增加维度时, ``unsqueeze`` 方法会按元素顺序依次增加维度。例如 Shape 为 [2, 3] 的 Tensor 在 axis = [0, 2]处增加维度, ``unsqueeze`` 方法会先在第一维度前插入一个维度, Shape 变为 [1, 2, 3],接着在第三维前插入一个维度, Shape 最终变为 [1, 2, 1, 3]。
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • 按元素顺序..可能会有点误解,可以说 Shape 的元素顺序
  • 第一维度第三维度 也会造成误解,直接说在 axis =0, axis = 2 前插入...

Copy link
Author

Choose a reason for hiding this comment

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

好的,已经进行了修改,感谢您指出错误!

@@ -9,6 +9,12 @@ unfold

仅在动态图下可用,返回的 Tensor 和 x 共享内存。

下图展示了一个元素值为 0-8 且 Shape 为 [9] 的 Tensor 如何使用 ``unfold`` 方法在第一个维度(axis = 0),使用大小为 2 的窗口(size = 0)根据 4 的步长(step = 4)进行采样。
Copy link
Collaborator

Choose a reason for hiding this comment

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

size = 0 是不是写错了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants