MCPcopy
hub / github.com/OpenPPL/ppq / RandomMemDataset

Class RandomMemDataset

ppq/quantization/algorithm/training.py:128–137  ·  view source on GitHub ↗

A very little helper class for randomly pick data samples from your dataset.

Source from the content-addressed store, hash-verified

126
127
128class RandomMemDataset:
129 """A very little helper class for randomly pick data samples from your
130 dataset."""
131 def __init__(self, data: Iterable) -> None:
132 self._data = data
133 self._num_of_batchs = len(data)
134
135 def pop(self):
136 idx = random.randint(0, self._num_of_batchs - 1)
137 return self._data[idx]
138
139
140class PriorityQueue:

Callers 1

calib_blockMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected