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.SequentialSampler.rst 1.1 kB

12345678910111213141516171819202122232425262728
  1. mindspore.dataset.SequentialSampler
  2. ===================================
  3. .. py:class:: mindspore.dataset.SequentialSampler(start_index=None, num_samples=None)
  4. 按顺序采样数据集元素,相当于不使用采样器。
  5. **参数:**
  6. - **start_index** (int, optional): 开始采样的索引。(默认值为None,从第一个ID开始)
  7. - **num_samples** (int, optional): 要采样的元素数量。(默认值为None,采样所有元素)
  8. **样例:**
  9. >>> # 创建SequentialSampler
  10. >>> sampler = ds.SequentialSampler()
  11. >>> dataset = ds.ImageFolderDataset(image_folder_dataset_dir,
  12. ... num_parallel_workers=8,
  13. ... sampler=sampler)
  14. **异常:**
  15. - **TypeError:** `start_index` 不是整数值。
  16. - **TypeError:** `num_samples` 不是整数值。
  17. - **RuntimeError:** `start_index` 为负值。
  18. - **ValueError:** `num_samples` 为负值。
  19. .. include:: mindspore.dataset.BuiltinSampler.rst