Skip to content
Merged
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
5 changes: 5 additions & 0 deletions docs/api/paddle/reshape_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ reshape
- 2。给定一个形状为[2,4,6]的三维 Tensor x,目标形状为[2,3,-1,2],则将 x 变换为形状为[2,3,4,2]的 4-D Tensor,且 x 的数据保持不变。在这种情况下,目标形状的一个维度被设置为-1,这个维度的值是从 x 的元素总数和剩余维度推断出来的。
- 3。给定一个形状为[2,4,6]的三维 Tensor x,目标形状为[-1,0,3,2],则将 x 变换为形状为[2,4,3,2]的 4-D Tensor,且 x 的数据保持不变。在这种情况下,0 对应位置的维度值将从 x 的对应维数中复制,-1 对应位置的维度值由 x 的元素总数和剩余维度推断出来。

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

.. image:: ../../images/reshape.png
:alt: 图例
Copy link
Contributor

Choose a reason for hiding this comment

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

感谢对PaddlePaddle开源框架的支持。Origin Tensor Shape: [2,4,6]的数据标注有些问题,Axis0是变化最慢的轴,Axis2是变化最快的轴,数据[1,2,3,4,5,6]应该是沿着Axis2轴排列,以此类推

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
Contributor

Choose a reason for hiding this comment

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

Great! Origin Tensor Shape: [2,4,6]的图例中每个轴的刻度单位应该是1,请调整Axis0和Axis1的刻度单位为1。Axis2的刻度单位已经是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.

已按要求修改,麻烦再查验一下,非常感谢!


参数
::::::::::::

Expand Down
Binary file added docs/images/reshape.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.