def batch_data(inputs, outputs, batch_size=16):
    """Convert full input/output pairs to a list of batched tuples"""
    n_examples = outputs.shape[0]
    return [
        (
            inputs[batch_size * i : batch_size * (i + 1)],
            outputs[batch_size * i : batch_size * (i + 1)],
        )
        for i in range(n_examples // batch_size)
    ]