diff --git a/python/paddle/fluid/dygraph/tensor_patch_methods.py b/python/paddle/fluid/dygraph/tensor_patch_methods.py index 765da4bcd88b9d88d789060e293737ae3f40bf78..0ba734237ffc857d80b94c35307fddede456a50c 100644 --- a/python/paddle/fluid/dygraph/tensor_patch_methods.py +++ b/python/paddle/fluid/dygraph/tensor_patch_methods.py @@ -734,13 +734,6 @@ def monkey_patch_tensor(): for slice_item in item: if isinstance(slice_item, (list, np.ndarray, Variable, range)): return True - elif isinstance(slice_item, slice): - if ( - isinstance(slice_item.start, Variable) - or isinstance(slice_item.stop, Variable) - or isinstance(slice_item.step, Variable) - ): - return True return False