Update to import TF 2.0 in many TensorFlow Privacy Python modules.

PiperOrigin-RevId: 425901093
This commit is contained in:
Michael Reneer 2022-02-02 09:17:00 -08:00 committed by A. Unique TensorFlower
parent 778c804d1b
commit c3e7f08fa5
14 changed files with 13 additions and 22 deletions

View file

@ -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

View file

@ -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):

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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