'Compute privacy spending in (e, d)-DP form for a single or list of eps.
Args:
sess: the session to run the tensor.
target_eps: a list of target epsilon\'s for which we would like to
compute corresponding delta value.
target_deltas: a list of target deltas for which we would like to
compute the corresponding eps value. Caller must specify
either target_eps or target_delta.
Returns:
A list of EpsDelta pairs.'

def get_privacy_spent(self, sess, target_eps=None, target_deltas=None):

    assert ((target_eps is None) ^ (target_deltas is None))
    eps_deltas = []
    log_moments = sess.run(self._log_moments)
    log_moments_with_order = zip(self._moment_orders, log_moments)
    if (target_eps is not None):
        for eps in target_eps:
            eps_deltas.append(EpsDelta(eps, self._compute_delta(log_moments_with_order, eps)))
    else:
        assert target_deltas
        for delta in target_deltas:
            eps_deltas.append(EpsDelta(self._compute_eps(log_moments_with_order, delta), delta))
    return eps_deltas
