未验证 提交 4061b1b8 编写于 作者: N Nyakku Shigure 提交者: GitHub

[CodeStyle][py2] remove the `next` method for python2 compatibility (PEP 3114) (#47728)

上级 fccf664f
...@@ -354,10 +354,6 @@ class _DataLoaderIterSingleProcess(_DataLoaderIterBase): ...@@ -354,10 +354,6 @@ class _DataLoaderIterSingleProcess(_DataLoaderIterBase):
self._thread = None self._thread = None
# python2 compatibility
def next(self):
return self.__next__()
def _try_shutdown_all(self): def _try_shutdown_all(self):
if not self._shutdown: if not self._shutdown:
try: try:
...@@ -854,10 +850,6 @@ class _DataLoaderIterMultiProcess(_DataLoaderIterBase): ...@@ -854,10 +850,6 @@ class _DataLoaderIterMultiProcess(_DataLoaderIterBase):
if in_profiler_mode(): if in_profiler_mode():
trace_event.end() trace_event.end()
# python2 compatibility
def next(self):
return self.__next__()
def _on_output_batch(self): def _on_output_batch(self):
for _ in range(len(self._places)): for _ in range(len(self._places)):
self._batches_outstanding -= 1 self._batches_outstanding -= 1
......
...@@ -152,15 +152,6 @@ class DataLoaderBase: ...@@ -152,15 +152,6 @@ class DataLoaderBase:
def __call__(self): def __call__(self):
return 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): def __iter__(self):
raise NotImplementedError() raise NotImplementedError()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册