Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiplexerLongest example snippet isn't very useful #1182

Open
lendle opened this issue Jun 12, 2023 · 0 comments
Open

MultiplexerLongest example snippet isn't very useful #1182

lendle opened this issue Jun 12, 2023 · 0 comments

Comments

@lendle
Copy link

lendle commented Jun 12, 2023

📚 The doc issue

https://pytorch.org/data/0.6/generated/torchdata.datapipes.iter.MultiplexerLongest.html#torchdata.datapipes.iter.MultiplexerLongest

The snippet in the docs

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

The three input datapipes all have the same length so the example doesn't show why this is different than Multiplexer.

Suggest a potential alternative/fix

Change the example so that one input datapipe is shorter in order to show why this is different than Multiplexer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant