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.add_sampler.rst 420 B

12345678910111213
  1. ..py:method:: add_sampler(new_sampler)
  2. 为当前数据集添加采样器。
  3. **参数:**
  4. **new_sampler** (Sampler) :作用于当前数据集的采样器。
  5. 样例:
  6. >>> # dataset为任意数据集实例
  7. >>> # 对该数据集应用DistributedSampler
  8. >>> new_sampler = ds.DistributedSampler(10, 2)
  9. >>> dataset.add_sampler(new_sampler)