From 3072c86c79733274823390cdd2b07fce731c2a07 Mon Sep 17 00:00:00 2001 From: jvmancuso Date: Sat, 20 Jul 2019 10:43:48 -0400 Subject: [PATCH] find nest module based on TF version for quantile_adaptive_clip_sum_query.py --- privacy/dp_query/quantile_adaptive_clip_sum_query.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/privacy/dp_query/quantile_adaptive_clip_sum_query.py b/privacy/dp_query/quantile_adaptive_clip_sum_query.py index 8960c14..d8f0cbb 100644 --- a/privacy/dp_query/quantile_adaptive_clip_sum_query.py +++ b/privacy/dp_query/quantile_adaptive_clip_sum_query.py @@ -26,6 +26,7 @@ from __future__ import division from __future__ import print_function import collections +from distutils.version import LooseVersion import tensorflow as tf @@ -33,7 +34,10 @@ from privacy.dp_query import dp_query from privacy.dp_query import gaussian_query from privacy.dp_query import normalized_query -nest = tf.contrib.framework.nest +if LooseVersion(tf.__version__) < LooseVersion('2.0.0'): + nest = tf.contrib.framework.nest +else: + nest = tf.nest class QuantileAdaptiveClipSumQuery(dp_query.DPQuery):