neural_compressor.experimental.data.dataloaders.sampler
¶
Definitions of the methods to sample data.
Module Contents¶
Classes¶
Base class for all Samplers. |
|
Interally samples elements. |
|
Sequentially samples elements, used for datasets retrieved element by index. |
|
Yield a batch of indices and number of batches. |
- class neural_compressor.experimental.data.dataloaders.sampler.Sampler(data_source)¶
Bases:
object
Base class for all Samplers.
__iter__ is needed no matter whether you use IterableSampler or Squential sampler, if you want implement your own sampler, make clear what the type is your Dataset, if IterableDataset(method __iter__ implemented), try to use IterableSampler, else if you have an IndexDataset(method __getitem__ implemented), your dataset should have method __len__ implemented.
- class neural_compressor.experimental.data.dataloaders.sampler.IterableSampler(dataset)¶
Bases:
Sampler
Interally samples elements.
Used for datasets retrieved element by interator. Yield None to act as a placeholder for each iteration.