diff --git a/python/paddle/fluid/dataloader/dataloader_iter.py b/python/paddle/fluid/dataloader/dataloader_iter.py index c89c3e079f62401567fd37a12816af8803273b94..f248a1188bbee0d7811a63bcb21aed4a75965626 100644 --- a/python/paddle/fluid/dataloader/dataloader_iter.py +++ b/python/paddle/fluid/dataloader/dataloader_iter.py @@ -354,10 +354,6 @@ class _DataLoaderIterSingleProcess(_DataLoaderIterBase): self._thread = None - # python2 compatibility - def next(self): - return self.__next__() - def _try_shutdown_all(self): if not self._shutdown: try: @@ -854,10 +850,6 @@ class _DataLoaderIterMultiProcess(_DataLoaderIterBase): if in_profiler_mode(): trace_event.end() - # python2 compatibility - def next(self): - return self.__next__() - def _on_output_batch(self): for _ in range(len(self._places)): self._batches_outstanding -= 1 diff --git a/python/paddle/fluid/reader.py b/python/paddle/fluid/reader.py index 2ad3e5903aab55e99c337bc234e2a869c87b9ca1..b6b774d5ba1a7f40db3e80fc7d236f789197fc6d 100644 --- a/python/paddle/fluid/reader.py +++ b/python/paddle/fluid/reader.py @@ -152,15 +152,6 @@ class DataLoaderBase: def __call__(self): return self - def next(self): - ''' - Get the next item in the DataLoader object. This method - should not be called by users directly. It is used for - implementing iterator protocol of Python 2.x inside - PaddlePaddle framework. - ''' - return self.__next__() - def __iter__(self): raise NotImplementedError()