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

Class Sampler

lib/utils/data/sampler.py:4–19  ·  view source on GitHub ↗

Base class for all Samplers. Every Sampler subclass has to provide an __iter__ method, providing a way to iterate over indices of dataset elements, and a __len__ method that returns the length of the returned iterators.

Source from the content-addressed store, hash-verified

2
3
4class Sampler(object):
5 """Base class for all Samplers.
6
7 Every Sampler subclass has to provide an __iter__ method, providing a way
8 to iterate over indices of dataset elements, and a __len__ method that
9 returns the length of the returned iterators.
10 """
11
12 def __init__(self, data_source):
13 pass
14
15 def __iter__(self):
16 raise NotImplementedError
17
18 def __len__(self):
19 raise NotImplementedError
20
21
22class SequentialSampler(Sampler):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected