You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.dataset.Dataset.use_sampler.rst 436 B

12345678910111213
  1. ..py:method:: use_sampler(new_sampler)
  2. 为当前数据集更换一个新的采样器。
  3. **参数:**
  4. **new_sampler** (Sampler) :替换的新采样器。
  5. 样例:
  6. >>> # dataset为任意数据集实例
  7. >>> # 将该数据集的采样器更换为DistributedSampler
  8. >>> new_sampler = ds.DistributedSampler(10, 2)
  9. >>> dataset.use_sampler(new_sampler)