Shortcuts

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)]

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources