mindspore2022/docs/api/api_python/dataset/mindspore.dataset.SubsetRan...

20 lines
794 B
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.dataset.SubsetRandomSampler
======================================
.. py:class:: mindspore.dataset.SubsetRandomSampler(indices, num_samples=None)
给定样本的索引序列,从序列中随机获取索引对数据集进行采样。
**参数:**
- **indices** (Iterable): 样本索引的序列除了string类型外的任意Python可迭代对象类型
- **num_samples** (int, 可选): 获取的样本数可用于部分获取采样得到的样本。默认值None获取采样到的所有样本。
**异常:**
- **TypeError** `indices` 的类型不是int。
- **TypeError** `num_samples` 的类型不是int。
- **ValueError** `num_samples` 为负值。
.. include:: mindspore.dataset.BuiltinSampler.rst