Shortcuts

Zipper

class torchdata.datapipes.iter.Zipper(*datapipes: IterDataPipe)

Aggregates elements into a tuple from each of the input DataPipes (functional name: zip). The output is stopped as soon as the shortest input DataPipe is exhausted.

Parameters:

*datapipes – Iterable DataPipes being aggregated

Example

>>> # xdoctest: +REQUIRES(module:torchdata)
>>> from torchdata.datapipes.iter import IterableWrapper
>>> dp1, dp2, dp3 = IterableWrapper(range(5)), IterableWrapper(range(10, 15)), IterableWrapper(range(20, 25))
>>> list(dp1.zip(dp2, dp3))
[(0, 10, 20), (1, 11, 21), (2, 12, 22), (3, 13, 23), (4, 14, 24)]

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