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.
| 2 | |
| 3 | |
| 4 | class 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 | |
| 22 | class SequentialSampler(Sampler): |
nothing calls this directly
no outgoing calls
no test coverage detected