diff --git a/mindspore/python/mindspore/ops/composite/multitype_ops/getitem_impl.py b/mindspore/python/mindspore/ops/composite/multitype_ops/getitem_impl.py index d4fb3e22fd7..9bbc54acaa8 100644 --- a/mindspore/python/mindspore/ops/composite/multitype_ops/getitem_impl.py +++ b/mindspore/python/mindspore/ops/composite/multitype_ops/getitem_impl.py @@ -137,6 +137,12 @@ def _tuple_getitem_by_slice(data, slice_index): start = slice_getitem(slice_index, "start") stop = slice_getitem(slice_index, "stop") step = slice_getitem(slice_index, "step") + if start is None: + start = 0 + if step is None: + step = 1 + if stop is None: + stop = (2**31-1) if step >= 1 else 0 return sequence_slice(data, start, stop, step) return _tuple_slice(data, slice_index)