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.35]为moveaxis增加图片说明 #6902

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/api/paddle/moveaxis_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ moveaxis

将输入 Tensor ``x`` 的轴从 ``source`` 位置移动到 ``destination`` 位置,其他轴按原来顺序排布。同时根据新的 shape,重排 Tensor 中的数据。

下图展示了代码示例中的第一个操作

.. image:: ../../images/api_legend/moveaxis.png
:width: 600
参数
:::::::::
- **x** (Tensor) - 输入的 N-D Tensor,数据类型为:bool、int32、int64、float32、float64、complex64、complex128。
Expand Down
Binary file added docs/images/api_legend/moveaxis.png
Copy link
Collaborator

Choose a reason for hiding this comment

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

一些小建议

  • axis=1 和 axis=2 的展示形式互换一下,这样会更直观一些,即[3,2,4]展示为 3 个平行的 2 行 4 列的矩阵。
  • 或许不用 paddle.ones 而用 paddle.arange 来创建比较合适,这样能直观看到每个元素的位置变化
  • 方向键下写明一些参数,如 source=.. destination=..,这样也更直观些

Copy link
Collaborator

@sunzhongkai588 sunzhongkai588 Nov 20, 2024

Choose a reason for hiding this comment

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

参考一下示例PR,站在阅读文档的开发者角度上做这个图例

  • 元素每个位置标上数据,否则图例作用不大
  • 同一tensor用同一个颜色

Copy link
Collaborator

Choose a reason for hiding this comment

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

@KDZZZZZZ 按照该要求修改

Copy link
Author

Choose a reason for hiding this comment

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

这就是示例pr里最直观的表达方式,色块的前后位置已经把矩阵变换表示出来了,我认为图形化比数字更好

Copy link
Collaborator

Choose a reason for hiding this comment

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

这就是示例pr里最直观的表达方式,色块的前后位置已经把矩阵变换表示出来了,我认为图形化比数字更好

那比如 x = paddle.arange(24).reshape([3, 2, 4]) 的前后变化呢,因为你的色块在比如 [0,0,0] [1,0,0] [2,0,0] 都是浅绿色的

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.