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 illustration for reshape API #63365

Merged
merged 11 commits into from
Apr 25, 2024
Merged

Conversation

WoWYoYLoL
Copy link
Contributor

@WoWYoYLoL WoWYoYLoL commented Apr 9, 2024

PR Category

User Experience

PR Types

Docs

Description

  • 为reshape API 增加图例

对应的中文文档修复为:PaddlePaddle/docs#6569

… my-branch

add illustration for the reshape API && fix grammatical mistakes of the
indefinite article
Copy link

paddle-bot bot commented Apr 9, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Apr 9, 2024
@WoWYoYLoL WoWYoYLoL changed the title My branch add illustration for reshape API Apr 9, 2024
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Apr 10, 2024
@@ -4345,11 +4345,15 @@ def reshape(x, shape, name=None):

- 3. Given a 3-D tensor x with a shape [2, 4, 6], and the target shape is [-1, 0, 3, 2], the reshape operator will transform x into a 4-D tensor with shape [2, 4, 3, 2] and leaving x's data unchanged. In this case, besides -1, 0 means the actual dimension value is going to be copied from the corresponding dimension of x.

The following figure illustrates the first example -- a 3D tensor of shape [2, 4, 6] is transformed into a 2D tensor of shape [6, 8], during which the order and values of the elements in the tensor remain unchanged. The elements in the two subdiagrams correspond to each other, clearly demonstrating how the reshape API works.

![illustration of reshape API](https://github.com/PaddlePaddle/docs/blob/develop/docs/images/reshape.png?raw=true "illustration of reshape API")
Copy link
Contributor

Choose a reason for hiding this comment

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

这边不要用 markdown 格式的图片引用,否则无法渲染,可以看预览。和中文( PaddlePaddle/docs#6569 )一致即可,但引用路径需要改一下,因为仓库换了(docs -> Paddle)。

因为英文文档是通过抽取源码里的docstring,生产.rst 文件,所以和中文一样,得符合 sphinx 语法。

Args:
x (Tensor): An N-D Tensor. The data type is ``float16``, ``float32``, ``float64``, ``int16``, ``int32``, ``int64``, ``int8``, ``uint8``, ``complex64``, ``complex128``, ``bfloat16`` or ``bool``.
x (Tensor): A N-D Tensor. The data type is ``float16``, ``float32``, ``float64``, ``int16``, ``int32``, ``int64``, ``int8``, ``uint8``, ``complex64``, ``complex128``, ``bfloat16`` or ``bool``.
Copy link
Contributor

Choose a reason for hiding this comment

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

很细心,但 N-D Tensor 的发音以元音音素开始(即 N "en" 的发音),因此前面应该使用 an1-D Tensor也同理("one"的发音开始)

不过 Tensor 前面确实是跟着 a

Copy link
Contributor

@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 merged commit 13caba9 into PaddlePaddle:develop Apr 25, 2024
28 of 29 checks passed
runzhech pushed a commit to runzhech/Paddle that referenced this pull request Apr 30, 2024
* feat:add illustration for reshape API && fix:grammatical mistakes of the indefinite article

* bug fixes

* add illustration for reshape API

* Update python/paddle/tensor/manipulation.py

* add illustration for reshape API

* Update python/paddle/tensor/manipulation.py

---------

Co-authored-by: zachary sun <70642955+sunzhongkai588@users.noreply.github.com>
runzhech pushed a commit to runzhech/Paddle that referenced this pull request Apr 30, 2024
* feat:add illustration for reshape API && fix:grammatical mistakes of the indefinite article

* bug fixes

* add illustration for reshape API

* Update python/paddle/tensor/manipulation.py

* add illustration for reshape API

* Update python/paddle/tensor/manipulation.py

---------

Co-authored-by: zachary sun <70642955+sunzhongkai588@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants