find nest module based on TF version for quantile_adaptive_clip_sum_query.py

This commit is contained in:
jvmancuso 2019-07-20 10:43:48 -04:00
parent 3de1fcd829
commit 3072c86c79

View file

@ -26,6 +26,7 @@ from __future__ import division
from __future__ import print_function from __future__ import print_function
import collections import collections
from distutils.version import LooseVersion
import tensorflow as tf 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 gaussian_query
from privacy.dp_query import normalized_query from privacy.dp_query import normalized_query
if LooseVersion(tf.__version__) < LooseVersion('2.0.0'):
nest = tf.contrib.framework.nest nest = tf.contrib.framework.nest
else:
nest = tf.nest
class QuantileAdaptiveClipSumQuery(dp_query.DPQuery): class QuantileAdaptiveClipSumQuery(dp_query.DPQuery):