MCPcopy Create free account
hub / github.com/Topdu/OpenOCR / __iter__

Method __iter__

tools/data/ratio_sampler.py:178–185  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

176 return batch_list
177
178 def __iter__(self):
179 if self.shuffle or self.is_training:
180 random.seed(self.epoch)
181 self.epoch += 1
182 self.batch_list = self.create_batch()
183 random.shuffle(self.batchs_in_one_epoch_id)
184 for batch_tuple_id in self.batchs_in_one_epoch_id:
185 yield self.batch_list[batch_tuple_id]
186
187 def set_epoch(self, epoch: int):
188 self.epoch = epoch

Callers

nothing calls this directly

Calls 1

create_batchMethod · 0.95

Tested by

no test coverage detected