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

Method _batch

data_utils/samplers.py:105–109  ·  view source on GitHub ↗

extracts samples only pertaining to this worker's batch

(self, batch)

Source from the content-addressed store, hash-verified

103 return self.train_iters
104
105 def _batch(self, batch):
106 """extracts samples only pertaining to this worker's batch"""
107 start = self.rank*self.batch_size//self.world_size
108 end = (self.rank+1)*self.batch_size//self.world_size
109 return batch[start:end]
110
111
112class DistributedBatchSampler(data.sampler.BatchSampler):

Callers 1

__iter__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected