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

Method _batch

data_utils/samplers.py:162–166  ·  view source on GitHub ↗

extracts samples only pertaining to this worker's batch

(self, batch)

Source from the content-addressed store, hash-verified

160 yield idx
161
162 def _batch(self, batch):
163 """extracts samples only pertaining to this worker's batch"""
164 start = self.rank*self.batch_size//self.world_size
165 end = (self.rank+1)*self.batch_size//self.world_size
166 return batch[start:end]

Callers 1

__iter__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected