Fix dependencies required by privacy_tests.

Update `distutils` to `packaging`.

PiperOrigin-RevId: 496713867
This commit is contained in:
Steve Chien 2022-12-20 11:48:44 -08:00 committed by A. Unique TensorFlower
parent 2040f08f0d
commit f99a74c7a4
4 changed files with 11 additions and 12 deletions

View file

@ -24,12 +24,15 @@ absl-py>=1.0,==1.*
attrs~=21.4
dm-tree==0.1.7
dp-accounting==0.3.0
immutabledict~=2.2
matplotlib~=3.3
mpmath~=1.2
numpy~=1.21
packaging~=22.0
pandas~=1.4
scikit-learn>=1.0,==1.*
scipy~=1.7
statsmodels~=0.13
tensorflow-datasets~=4.5
tensorflow-estimator~=2.4
tensorflow-probability==0.15.0

View file

@ -31,11 +31,15 @@ setup(
'attrs~=21.4',
'dm-tree==0.1.7',
'dp-accounting==0.3.0',
'immutabledict~=2.2',
'matplotlib~=3.3',
'numpy~=1.21',
'packaging~=22.0',
'pandas~=1.4',
'parameterized~=0.8',
'scikit-learn>=1.0,==1.*',
'scipy~=1.7',
'statsmodels~=0.13',
'tensorflow-datasets~=4.5',
'tensorflow-estimator~=2.4',
'tensorflow-probability==0.15.0',

View file

@ -14,9 +14,8 @@
"""Implements DPQuery interface for Gaussian sum queries."""
import collections
import distutils
import dp_accounting
import packaging
import tensorflow as tf
from tensorflow_privacy.privacy.dp_query import dp_query
@ -79,8 +78,8 @@ class GaussianSumQuery(dp_query.SumAggregationDPQuery):
def get_noised_result(self, sample_state, global_state):
"""Implements `tensorflow_privacy.DPQuery.get_noised_result`."""
if distutils.version.LooseVersion(
tf.__version__) < distutils.version.LooseVersion('2.0.0'):
if packaging.version.Version(
tf.__version__) < packaging.version.Version('2.0.0'):
def add_noise(v):
return v + tf.random.normal(

View file

@ -15,10 +15,7 @@ py_test(
srcs = ["utils_test.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = [
":utils",
"//third_party/py/parameterized",
],
deps = [":utils"],
)
py_test(
@ -36,8 +33,4 @@ py_library(
py_library(
name = "epsilon_lower_bound",
srcs = ["epsilon_lower_bound.py"],
deps = [
"//third_party/py/immutabledict",
"//third_party/py/statsmodels",
],
)