MCPcopy Create free account
hub / github.com/THUDM/GLM / __iter__

Method __iter__

data_utils/samplers.py:96–100  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

94 self.batch_bias = [i * (num_samples // batch_size) for i in range(batch_size)]
95
96 def __iter__(self):
97 for idx in range(self.start_iter, self.train_iters * 10):
98 batch = [(idx + bias) % self.num_samples for bias in self.batch_bias]
99 tbatch = self._batch(batch)
100 yield tbatch
101
102 def __len__(self):
103 return self.train_iters

Callers

nothing calls this directly

Calls 1

_batchMethod · 0.95

Tested by

no test coverage detected