MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / ordered_indices

Method ordered_indices

tasks/base_task.py:60–69  ·  view source on GitHub ↗

Return an ordered list of indices. Batches will be constructed based on this order.

(self)

Source from the content-addressed store, hash-verified

58 return size
59
60 def ordered_indices(self):
61 """Return an ordered list of indices. Batches will be constructed based
62 on this order."""
63 if self.shuffle:
64 indices = np.random.permutation(len(self))
65 if self.sort_by_len:
66 indices = indices[np.argsort(np.array(self._sizes)[indices], kind='mergesort')]
67 else:
68 indices = np.arange(len(self))
69 return indices
70
71 @property
72 def num_workers(self):

Callers 1

build_dataloaderMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected