diff --git a/tensorflow_privacy/privacy/dp_query/distributed_discrete_gaussian_query_test.py b/tensorflow_privacy/privacy/dp_query/distributed_discrete_gaussian_query_test.py index 1c1a461..6ea5b94 100644 --- a/tensorflow_privacy/privacy/dp_query/distributed_discrete_gaussian_query_test.py +++ b/tensorflow_privacy/privacy/dp_query/distributed_discrete_gaussian_query_test.py @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -"""Tests for DistributedDiscreteGaussianSumQuery.""" from absl.testing import parameterized import numpy as np diff --git a/tensorflow_privacy/privacy/dp_query/dp_query.py b/tensorflow_privacy/privacy/dp_query/dp_query.py index 4dfe962..008ff9b 100644 --- a/tensorflow_privacy/privacy/dp_query/dp_query.py +++ b/tensorflow_privacy/privacy/dp_query/dp_query.py @@ -44,7 +44,7 @@ throughout the entire training process, the global state is usually None. import abc import collections -import tensorflow.compat.v1 as tf +import tensorflow as tf class DPQuery(metaclass=abc.ABCMeta): diff --git a/tensorflow_privacy/privacy/dp_query/gaussian_query.py b/tensorflow_privacy/privacy/dp_query/gaussian_query.py index d382a5b..bdc09b7 100644 --- a/tensorflow_privacy/privacy/dp_query/gaussian_query.py +++ b/tensorflow_privacy/privacy/dp_query/gaussian_query.py @@ -16,8 +16,7 @@ import collections import distutils -import tensorflow.compat.v1 as tf - +import tensorflow as tf from tensorflow_privacy.privacy.analysis import dp_event from tensorflow_privacy.privacy.dp_query import dp_query diff --git a/tensorflow_privacy/privacy/dp_query/nested_query.py b/tensorflow_privacy/privacy/dp_query/nested_query.py index a8e080c..07e9393 100644 --- a/tensorflow_privacy/privacy/dp_query/nested_query.py +++ b/tensorflow_privacy/privacy/dp_query/nested_query.py @@ -15,8 +15,7 @@ import collections -import tensorflow.compat.v1 as tf - +import tensorflow as tf from tensorflow_privacy.privacy.analysis import dp_event from tensorflow_privacy.privacy.dp_query import dp_query import tree diff --git a/tensorflow_privacy/privacy/dp_query/nested_query_test.py b/tensorflow_privacy/privacy/dp_query/nested_query_test.py index e4b8682..8683a8e 100644 --- a/tensorflow_privacy/privacy/dp_query/nested_query_test.py +++ b/tensorflow_privacy/privacy/dp_query/nested_query_test.py @@ -16,8 +16,7 @@ import collections from absl.testing import parameterized import numpy as np -import tensorflow.compat.v1 as tf - +import tensorflow as tf from tensorflow_privacy.privacy.dp_query import dp_query from tensorflow_privacy.privacy.dp_query import gaussian_query from tensorflow_privacy.privacy.dp_query import nested_query diff --git a/tensorflow_privacy/privacy/dp_query/no_privacy_query.py b/tensorflow_privacy/privacy/dp_query/no_privacy_query.py index 2b35de1..9e640f1 100644 --- a/tensorflow_privacy/privacy/dp_query/no_privacy_query.py +++ b/tensorflow_privacy/privacy/dp_query/no_privacy_query.py @@ -13,8 +13,7 @@ # limitations under the License. """Implements DPQuery interface for no privacy average queries.""" -import tensorflow.compat.v1 as tf - +import tensorflow as tf from tensorflow_privacy.privacy.analysis import dp_event from tensorflow_privacy.privacy.dp_query import dp_query diff --git a/tensorflow_privacy/privacy/dp_query/no_privacy_query_test.py b/tensorflow_privacy/privacy/dp_query/no_privacy_query_test.py index 06dc655..87ca4b8 100644 --- a/tensorflow_privacy/privacy/dp_query/no_privacy_query_test.py +++ b/tensorflow_privacy/privacy/dp_query/no_privacy_query_test.py @@ -13,8 +13,7 @@ # limitations under the License. from absl.testing import parameterized -import tensorflow.compat.v1 as tf - +import tensorflow as tf from tensorflow_privacy.privacy.dp_query import no_privacy_query from tensorflow_privacy.privacy.dp_query import test_utils diff --git a/tensorflow_privacy/privacy/dp_query/normalized_query.py b/tensorflow_privacy/privacy/dp_query/normalized_query.py index b76a493..e6e1b9c 100644 --- a/tensorflow_privacy/privacy/dp_query/normalized_query.py +++ b/tensorflow_privacy/privacy/dp_query/normalized_query.py @@ -15,8 +15,7 @@ import collections -import tensorflow.compat.v1 as tf - +import tensorflow as tf from tensorflow_privacy.privacy.dp_query import dp_query diff --git a/tensorflow_privacy/privacy/dp_query/normalized_query_test.py b/tensorflow_privacy/privacy/dp_query/normalized_query_test.py index c035c77..0e12185 100644 --- a/tensorflow_privacy/privacy/dp_query/normalized_query_test.py +++ b/tensorflow_privacy/privacy/dp_query/normalized_query_test.py @@ -12,8 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import tensorflow.compat.v1 as tf - +import tensorflow as tf from tensorflow_privacy.privacy.dp_query import gaussian_query from tensorflow_privacy.privacy.dp_query import normalized_query from tensorflow_privacy.privacy.dp_query import test_utils diff --git a/tensorflow_privacy/privacy/dp_query/quantile_adaptive_clip_sum_query.py b/tensorflow_privacy/privacy/dp_query/quantile_adaptive_clip_sum_query.py index b551de9..9ab43b8 100644 --- a/tensorflow_privacy/privacy/dp_query/quantile_adaptive_clip_sum_query.py +++ b/tensorflow_privacy/privacy/dp_query/quantile_adaptive_clip_sum_query.py @@ -15,8 +15,7 @@ import collections -import tensorflow.compat.v1 as tf - +import tensorflow as tf from tensorflow_privacy.privacy.analysis import dp_event from tensorflow_privacy.privacy.dp_query import dp_query from tensorflow_privacy.privacy.dp_query import gaussian_query diff --git a/tensorflow_privacy/privacy/dp_query/quantile_estimator_query.py b/tensorflow_privacy/privacy/dp_query/quantile_estimator_query.py index bb65e3f..d09b5de 100644 --- a/tensorflow_privacy/privacy/dp_query/quantile_estimator_query.py +++ b/tensorflow_privacy/privacy/dp_query/quantile_estimator_query.py @@ -15,7 +15,7 @@ import collections -import tensorflow.compat.v1 as tf +import tensorflow as tf from tensorflow_privacy.privacy.dp_query import dp_query from tensorflow_privacy.privacy.dp_query import gaussian_query from tensorflow_privacy.privacy.dp_query import no_privacy_query diff --git a/tensorflow_privacy/privacy/dp_query/restart_query.py b/tensorflow_privacy/privacy/dp_query/restart_query.py index 38c08f9..7f391db 100644 --- a/tensorflow_privacy/privacy/dp_query/restart_query.py +++ b/tensorflow_privacy/privacy/dp_query/restart_query.py @@ -15,12 +15,12 @@ This query is used to compose with a DPQuery that has `reset_state` function. """ + import abc import collections from typing import Optional import tensorflow as tf - from tensorflow_privacy.privacy.dp_query import dp_query diff --git a/tensorflow_privacy/privacy/privacy_tests/membership_inference_attack/keras_evaluation_test.py b/tensorflow_privacy/privacy/privacy_tests/membership_inference_attack/keras_evaluation_test.py index 69fdcfd..1c4760d 100644 --- a/tensorflow_privacy/privacy/privacy_tests/membership_inference_attack/keras_evaluation_test.py +++ b/tensorflow_privacy/privacy/privacy_tests/membership_inference_attack/keras_evaluation_test.py @@ -14,7 +14,7 @@ from absl.testing import absltest import numpy as np -import tensorflow.compat.v1 as tf +import tensorflow as tf from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack import keras_evaluation from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.data_structures import AttackResults from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.data_structures import AttackType diff --git a/tutorials/mnist_dpsgd_tutorial_common.py b/tutorials/mnist_dpsgd_tutorial_common.py index 78bcce4..a4fb2c0 100644 --- a/tutorials/mnist_dpsgd_tutorial_common.py +++ b/tutorials/mnist_dpsgd_tutorial_common.py @@ -13,7 +13,7 @@ # limitations under the License. """Common tools for DP-SGD MNIST tutorials.""" -import tensorflow.compat.v1 as tf +import tensorflow as tf import tensorflow_datasets as tfds