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

Method _next_indices

python/dgl/dataloading/dataloader.py:67–79  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

65 return self
66
67 def _next_indices(self):
68 num_items = self.dataset.shape[0]
69 if self.index >= num_items:
70 raise StopIteration
71 end_idx = self.index + self.batch_size
72 if end_idx > num_items:
73 if self.drop_last:
74 raise StopIteration
75 end_idx = num_items
76 batch = self.dataset[self.index : end_idx]
77 self.index += self.batch_size
78
79 return batch
80
81 def __next__(self):
82 batch = self._next_indices()

Callers 1

__next__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected