Shortcuts

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]

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