Shortcuts

Concater

class torchdata.datapipes.map.Concater(*datapipes: MapDataPipe)

Concatenate multiple Map DataPipes (functional name: concat). The new index of is the cumulative sum of source DataPipes. For example, if there are 2 source DataPipes both with length 5, index 0 to 4 of the resulting ConcatMapDataPipe would refer to elements of the first DataPipe, and 5 to 9 would refer to elements of the second DataPipe.

Parameters:

datapipes – Map DataPipes being concatenated

Example

>>> # xdoctest: +SKIP
>>> from torchdata.datapipes.map import SequenceWrapper
>>> dp1 = SequenceWrapper(range(3))
>>> dp2 = SequenceWrapper(range(3))
>>> concat_dp = dp1.concat(dp2)
>>> list(concat_dp)
[0, 1, 2, 0, 1, 2]

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