采样器¶
- class torchdata.datapipes.iter.Sampler(datapipe: IterDataPipe, sampler: Type[Sampler] = SequentialSampler, sampler_args: Optional[Tuple] = None, sampler_kwargs: Optional[Dict] = None)¶
使用提供的
Sampler
生成样本元素(默认为SequentialSampler
)。- 参数:
datapipe – 要从中采样的 IterDataPipe
sampler – 用于从输入 DataPipe 生成样本元素的采样器类。对于 IterDataPipe,默认为
SequentialSampler