StreamSampler#

class StreamSampler(batch_size=1)[source]#

Sampler for stream dataset.

Warning

In the case of multiple machines, sampler should ensure that each worker gets different data. But this class cannot do it yet, please build your own dataset and sampler to achieve this goal.

Usually, __iter__ can return different iterator by rank = dist.get_rank(). So that they will get different data.