def METHOD_NAME(model, batches, n_times=1):
    total = 0.0
    for _ in range(n_times):
        for X, Y in tqdm.tqdm(batches):
            Yh, get_dX = model.begin_update(X)
            get_dX(Yh)
            total += Yh.data.sum()
    return float(total)