Skip to content

Commit

Permalink
correct SampleMultiplexer docstring example (#1195)
Browse files Browse the repository at this point in the history
Summary:
### Changes

- correct docstring of SampleMultiplexerDataPipe. The examples show a result of multiplexing 2 datapipes of length 5 but the two datapipes are initialized with 10 elements each

Pull Request resolved: #1195

Reviewed By: andrewkho

Differential Revision: D55360984

Pulled By: gokulavasan

fbshipit-source-id: 969a07de7aeb7439ca3f5518652e1d78a931cbb1
  • Loading branch information
timothee1996 authored and facebook-github-bot committed Mar 27, 2024
1 parent 28f34d3 commit 66f0b98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions torchdata/datapipes/iter/util/samplemultiplexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class SampleMultiplexerDataPipe(IterDataPipe[T_co]):
Example:
>>> from torchdata.datapipes.iter import IterableWrapper, SampleMultiplexer
>>> source_dp1 = IterableWrapper([0] * 10)
>>> source_dp2 = IterableWrapper([1] * 10)
>>> source_dp1 = IterableWrapper([0] * 5)
>>> source_dp2 = IterableWrapper([1] * 5)
>>> d = {source_dp1: 99999999, source_dp2: 0.0000001}
>>> sample_mul_dp = SampleMultiplexer(pipes_to_weights_dict=d, seed=0)
>>> list(sample_mul_dp)
Expand Down

0 comments on commit 66f0b98

Please sign in to comment.