# SubsetRandomSampler

Source: https://www.tensorplay.cn/docs/generated/tensorplay.utils.data.SubsetRandomSampler.html

# SubsetRandomSampler

class tensorplay.utils.data.SubsetRandomSampler(indices: [Sequence](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence)[[int](https://docs.python.org/3/library/functions.html#int)], generator: [Generator](tensorplay.Generator.html#tensorplay.Generator) | [None](https://docs.python.org/3/library/constants.html#None) = None)[[source]](../_modules/tensorplay/utils/data.html#SubsetRandomSampler)

Samples elements randomly from a given list of indices, without replacement.

Parameters:

- indices ( sequence ) – a sequence of indices

- generator ([Generator](tensorplay.Generator.html#tensorplay.Generator)) – Generator used in sampling.
