Return an ordered list of indices. Batches will be constructed based on this order.
(self)
| 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): |