Concater¶
- class torchdata.datapipes.iter.Concater(*datapipes: IterDataPipe)¶
Concatenates multiple Iterable DataPipes (functional name:
concat
). The resulting DataPipe will yield all the elements from the first input DataPipe, before yielding from the subsequent ones.- Parameters:
datapipes – Iterable DataPipes being concatenated
Example
>>> # xdoctest: +REQUIRES(module:torchdata) >>> import random >>> from torchdata.datapipes.iter import IterableWrapper >>> dp1 = IterableWrapper(range(3)) >>> dp2 = IterableWrapper(range(5)) >>> list(dp1.concat(dp2)) [0, 1, 2, 0, 1, 2, 3, 4]