def METHOD_NAME():
    range_fn = np.random.permutation if self._shuffle else np.arange
    batch = []
    for iid in range_fn(len(self._dataset)):
        batch.append(self._dataset[iid])
        if len(batch) == self._batch_size:
            outputs = self._collate_fn(batch, self.config.model)
            batch = []
            if len(outputs[1]) == 0:
                continue
            yield outputs
    if len(batch) > 0 and not self._drop_last:
        yield self._collate_fn(batch, self.config.model)