forked from 626_privacy/tensorflow_privacy
Update to import TF 2.0 in many TensorFlow Privacy Python modules.
PiperOrigin-RevId: 425901093
This commit is contained in:
parent
778c804d1b
commit
c3e7f08fa5
14 changed files with 13 additions and 22 deletions
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue