From 031978b6bc646381e0d55837982112768b3e85d6 Mon Sep 17 00:00:00 2001 From: Aoraki-Dream Date: Wed, 25 Sep 2024 13:45:22 +0000 Subject: [PATCH 1/2] update doc for crop picture --- python/paddle/tensor/manipulation.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/python/paddle/tensor/manipulation.py b/python/paddle/tensor/manipulation.py index 73429bc373801..40822e0788796 100644 --- a/python/paddle/tensor/manipulation.py +++ b/python/paddle/tensor/manipulation.py @@ -796,6 +796,14 @@ def crop( [[3, 4, 5], [6, 7, 8]]] + The image below demonstrates the scenario in Case 2—where a 3D tensor with shape [2,3,4] is cropped into a 3D tensor with shape [2,2,3], while maintaining the order and values of the elements within the tensor unchanged. + By comparing the two, you can clearly see the correspondence of elements before and after the tensor's shape changes. + + .. image:: https://githubraw.cdn.bcebos.com/PaddlePaddle/docs/develop/docs/images/api_legend/crop.png + :width: 500 + :alt: Illustration of Case 2 + :align: center + Parameters: x (Tensor): 1-D to 6-D Tensor, the data type is float32, float64, int32 or int64. shape (list|tuple|Tensor, optional): The output shape is specified From 86cfd50369751963feff95a373e46e15d8478319 Mon Sep 17 00:00:00 2001 From: zachary sun <70642955+sunzhongkai588@users.noreply.github.com> Date: Fri, 27 Sep 2024 14:24:58 +0800 Subject: [PATCH 2/2] Update python/paddle/tensor/manipulation.py --- python/paddle/tensor/manipulation.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/paddle/tensor/manipulation.py b/python/paddle/tensor/manipulation.py index 40822e0788796..5f588b2fdd5cf 100644 --- a/python/paddle/tensor/manipulation.py +++ b/python/paddle/tensor/manipulation.py @@ -796,8 +796,7 @@ def crop( [[3, 4, 5], [6, 7, 8]]] - The image below demonstrates the scenario in Case 2—where a 3D tensor with shape [2,3,4] is cropped into a 3D tensor with shape [2,2,3], while maintaining the order and values of the elements within the tensor unchanged. - By comparing the two, you can clearly see the correspondence of elements before and after the tensor's shape changes. + The image below demonstrates the Case 2 that a 3D tensor with shape [2,3,4] is cropped into a 3D tensor with shape [2,2,3] .. image:: https://githubraw.cdn.bcebos.com/PaddlePaddle/docs/develop/docs/images/api_legend/crop.png :width: 500