forked from 626_privacy/tensorflow_privacy
Update use of tf.CriticalSection.
PiperOrigin-RevId: 233168852
This commit is contained in:
parent
d75f1b80ba
commit
72305bcb10
1 changed files with 6 additions and 1 deletions
|
@ -76,6 +76,11 @@ 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')
|
||||||
|
try:
|
||||||
|
# Newer versions of TF
|
||||||
|
self._cs = tf.CriticalSection()
|
||||||
|
except AttributeError:
|
||||||
|
# Older versions of TF
|
||||||
self._cs = tf.contrib.framework.CriticalSection()
|
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):
|
||||||
|
|
Loading…
Reference in a new issue