diff --git a/returnn/datasets/postprocessing.py b/returnn/datasets/postprocessing.py index 738c87412..08cac3c55 100644 --- a/returnn/datasets/postprocessing.py +++ b/returnn/datasets/postprocessing.py @@ -364,11 +364,11 @@ def __call__(self, iterator: Iterator[TensorDict], **kwargs) -> Iterator[TensorD is_down_phase = False seq_buffer = list(islice(iterator, self.num_seqs_per_bin)) + has_ended = False while True: seq_buffer.sort(key=self._get_seq_len, reverse=is_down_phase) next_seq_buffer = [] - has_ended = False # Yield items to trainer while gradually pulling more data from PP function. # This optimizes CPU load when multiple workers are used.