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.6]add the picture of crop #6786

Merged
merged 9 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
9 changes: 9 additions & 0 deletions docs/api/paddle/crop_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ crop
[[3, 4, 5],
[6, 7, 8]]]

**示例二图解说明**:

下图展示了示例二中的情形——一个形状为[2,2,2]的三维张量通过 crop 操作裁剪为形状为[2,2,1]的三维张量,同时保持了张量中元素的顺序和值不变。通过比较,可以清晰地看到张量形状变化前后各元素的对应关系。

.. figure:: ../../images/api_legend/crop.png
:width: 500
:alt: 示例二图示
:align: center

参数
:::::::::

Expand Down
Binary file added docs/images/api_legend/crop.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 吧, 比如 0 ... 1,小数没太大意义
  • 每个位置都元素可以放大一些(小圆点以及其数字),或者小圆点改成小方块

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

Choose a reason for hiding this comment

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

这个图片是不是没截全? 最上面的 Original Tensor 截了一半

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

Choose a reason for hiding this comment

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

临时加个需求,可以换种表现形式吗,更加直观一点,比如
image

参考 https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/beginner/tensor_cn.html#span-id-newtensor1-2-1-span

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改,请求review @sunzhongkai588

Copy link
Collaborator

Choose a reason for hiding this comment

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

sorry 是我之前没说清楚~

  • 方向键上的数字替换为轴,比如 axis=0 ....
  • 同一tensor的两张图可以靠的近一些,显得更加立体

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的,已修改 @sunzhongkai588

Copy link
Collaborator

Choose a reason for hiding this comment

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

图维度好像写错了..按这个来的话,变成了 [2,2,2] -> [1,2,2]
一般来说,3d tesnro 里 axis =1 代表矩阵的行, axis = 2 代表矩阵的列 ,axis = 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.

明白了,已修改 @sunzhongkai588

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