MCPcopy Create free account
hub / github.com/FreeformRobotics/OTS / SequentialSampler

Class SequentialSampler

lib/utils/data/sampler.py:22–36  ·  view source on GitHub ↗

Samples elements sequentially, always in the same order. Arguments: data_source (Dataset): dataset to sample from

Source from the content-addressed store, hash-verified

20
21
22class SequentialSampler(Sampler):
23 """Samples elements sequentially, always in the same order.
24
25 Arguments:
26 data_source (Dataset): dataset to sample from
27 """
28
29 def __init__(self, data_source):
30 self.data_source = data_source
31
32 def __iter__(self):
33 return iter(range(len(self.data_source)))
34
35 def __len__(self):
36 return len(self.data_source)
37
38
39class RandomSampler(Sampler):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected