Zipper¶
- class torchdata.datapipes.map.Zipper(*datapipes: MapDataPipe[T_co])¶
Aggregates elements into a tuple from each of the input DataPipes (functional name:
zip
). This MataPipe is out of bound as soon as the shortest input DataPipe is exhausted.- Parameters:
*datapipes – Map DataPipes being aggregated
Example
>>> # xdoctest: +SKIP >>> from torchdata.datapipes.map import SequenceWrapper >>> dp1 = SequenceWrapper(range(3)) >>> dp2 = SequenceWrapper(range(10, 13)) >>> zip_dp = dp1.zip(dp2) >>> list(zip_dp) [(0, 10), (1, 11), (2, 12)]