cerebras.modelzoo.common.pytorch_utils.SampleGenerator#

class cerebras.modelzoo.common.pytorch_utils.SampleGenerator(data, sample_count)[source]#

Bases: object

Iterator which returns multiple samples of a given input data.

Can be used in place of a PyTorch DataLoader to generate synthetic data.

Parameters
  • data – The data which should be returned at each iterator step.

  • sample_count – The maximum number of data samples to be returned.

Methods

next

Generate next data sample.

next()[source]#

Generate next data sample.