From e5bb87853ba055f8db04a54c129ee6f08f9ac7c9 Mon Sep 17 00:00:00 2001 From: zyfncg Date: Tue, 8 Nov 2022 11:15:59 +0800 Subject: [PATCH] fix examplce code of slice api (#47735) --- python/paddle/tensor/manipulation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/paddle/tensor/manipulation.py b/python/paddle/tensor/manipulation.py index 84a7b7a385a..c1307e218a7 100644 --- a/python/paddle/tensor/manipulation.py +++ b/python/paddle/tensor/manipulation.py @@ -183,13 +183,13 @@ def slice(input, axes, starts, ends): starts = [-3, 0, 2] ends = [3, 2, 4] sliced_1 = paddle.slice(input, axes=axes, starts=starts, ends=ends) - # sliced_1 is input[0:3, 0:2, 2:4]. + # sliced_1 is input[1:3, 0:2, 2:4]. # example 2: # attr starts is a list which contain tensor. minus_3 = paddle.full([1], -3, "int32") sliced_2 = paddle.slice(input, axes=axes, starts=[minus_3, 0, 2], ends=ends) - # sliced_2 is input[0:3, 0:2, 2:4]. + # sliced_2 is input[1:3, 0:2, 2:4]. """ if in_dygraph_mode(): attrs = () -- GitLab