def eval_acc(test_fn, all_examples):
    """
        Evaluate accuracy on `all_examples`.
    """
    acc = 0
    n_examples = 0
    prediction = []
    for x1, mask1, x2, mask2, x3, mask3, y in all_examples:
        tot_acc, pred = test_fn(x1, mask1, x2, mask2, x3, mask3, y)
        acc += tot_acc
        prediction += pred.tolist()
        n_examples += len(x1)
    return acc * 100.0 / n_examples, prediction