if shuffle:
random.shuffle(order)
for i in range((num_dialogs - 1) // batch_size + 1):
print("Getting dialogs =", [dialog_indices[o] for o in
order[i*batch_size:(i+1)*batch_size]])
yield list(itertools.chain.from_iterable(
_dialog(dialog_indices[o])\
for o in order[i*batch_size:(i+1)*batch_size]))
After Change
self.random_state = random.getstate()
random.setstate(rs)
for i in order:
for x, y in dialogs[i]:
yield [x], [y]
@staticmethod
def _dialogs(data):
dialogs = []
for x, y in data: