Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Merged
merged 8 commits into from
Dec 2, 2024

Conversation

zeroader
Copy link
Contributor

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
Contributor 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 是不是写错了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

是的,已修改

Copy link
Collaborator

@sunzhongkai588 sunzhongkai588 left a comment

Choose a reason for hiding this comment

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

LGTM,英文文档也加一下吧

@sunzhongkai588 sunzhongkai588 changed the title [Docathon][Add API Legend No.51] add a figure of unfold method and update unfold_cn.rst [Docathon][Add API Legend No.40、51] add a figure of unfold method and update unfold_cn.rst Dec 2, 2024
@luotao1 luotao1 changed the title [Docathon][Add API Legend No.40、51] add a figure of unfold method and update unfold_cn.rst [Docathon][Add API Legend No.40、51] add a figure of unfold method and update unfold_cn.rst -part Dec 2, 2024
@luotao1 luotao1 merged commit cd2eebc into PaddlePaddle:develop Dec 2, 2024
2 checks passed
@zeroader zeroader deleted the my-cool-stuff2 branch December 2, 2024 09:49
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
contributor HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants