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 433 B

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