diff --git a/python/mxnet/ndarray/ndarray.py b/python/mxnet/ndarray/ndarray.py index 16671b7d191f..6c2bb8078922 100644 --- a/python/mxnet/ndarray/ndarray.py +++ b/python/mxnet/ndarray/ndarray.py @@ -998,18 +998,7 @@ def _get_nd_basic_indexing(self, key): slc_key, self.shape, keep_none=False ) - # handle zero-size outputs - shape = list(self.shape) - i = 0 - zero_size = False - for b, e, s in zip(begin, end, step): # pylint: disable=invalid-name - if b >= e and s > 0 or b <= e and s < 0: - shape[i] = 0 - zero_size = True - i += 1 - if zero_size: - sliced = empty(tuple(shape), dtype=self.dtype, ctx=self.context) - elif self._basic_indexing_slice_is_contiguous(slc_key, self.shape): + if self._basic_indexing_slice_is_contiguous(slc_key, self.shape): # Create a shared-memory view by using low-level flat slicing flat_begin, flat_end = self._basic_indexing_contiguous_flat_begin_end( slc_key, self.shape