Skip to content

Commit ce922cc

Browse files
committed
try clear demux buffers
1 parent 3174d0f commit ce922cc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

test/test_prototype_builtin_datasets.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import functools
22
import gc
33
import io
4-
import itertools
54
import pickle
65
from pathlib import Path
76

@@ -88,8 +87,8 @@ def test_sample(self, test_home, dataset_mock, config):
8887
if not isinstance(dp, _DemultiplexerIterDataPipe):
8988
continue
9089

91-
for _, buffer in itertools.chain.from_iterable(dp.child_buffers):
92-
buffer.close()
90+
for dq in dp.child_buffers:
91+
dq.clear()
9392

9493
if not isinstance(sample, dict):
9594
raise AssertionError(f"Samples should be dictionaries, but got {type(sample)} instead.")

0 commit comments

Comments
 (0)