MCPcopy
hub / github.com/dmlc/dgl / shuffle

Method shuffle

python/dgl/dataloading/dataloader.py:314–321  ·  view source on GitHub ↗

Shuffles the dataset.

(self)

Source from the content-addressed store, hash-verified

312 assert len(self._id_tensor) == self.num_samples
313
314 def shuffle(self):
315 """Shuffles the dataset."""
316 np.random.shuffle(self._indices[: self.local_num_indices].numpy())
317 if not self.drop_last:
318 # pad extra from local indices
319 self._indices[self.local_num_indices :] = self._indices[
320 : self.num_samples - self.local_num_indices
321 ]
322
323 def __iter__(self):
324 indices = _divide_by_worker(

Callers

nothing calls this directly

Calls 1

shuffleMethod · 0.45

Tested by

no test coverage detected