Update use of tf.CriticalSection.

PiperOrigin-RevId: 233168852
This commit is contained in:
Eugene Brevdo 2019-02-08 20:08:13 -08:00 committed by A. Unique TensorFlower
parent d75f1b80ba
commit 72305bcb10

View file

@ -76,7 +76,12 @@ class PrivacyLedger(object):
initial_value=0.0, trainable=False, name='sample_count') initial_value=0.0, trainable=False, name='sample_count')
self._query_count = tf.Variable( self._query_count = tf.Variable(
initial_value=0.0, trainable=False, name='query_count') initial_value=0.0, trainable=False, name='query_count')
self._cs = tf.contrib.framework.CriticalSection() try:
# Newer versions of TF
self._cs = tf.CriticalSection()
except AttributeError:
# Older versions of TF
self._cs = tf.contrib.framework.CriticalSection()
def record_sum_query(self, l2_norm_bound, noise_stddev): def record_sum_query(self, l2_norm_bound, noise_stddev):
"""Records that a query was issued. """Records that a query was issued.