mirror of
https://github.com/google-deepmind/deepmind-research.git
synced 2026-05-27 10:15:44 +08:00
Explicitly replace "import tensorflow" with "tensorflow.compat.v1"
PiperOrigin-RevId: 288392606
This commit is contained in:
committed by
Diego de Las Casas
parent
8b47d2a576
commit
b8cf44502b
+1
-1
@@ -19,7 +19,7 @@ from __future__ import print_function
|
|||||||
import math
|
import math
|
||||||
|
|
||||||
import sonnet as snt
|
import sonnet as snt
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
|
|
||||||
from cs_gan import utils
|
from cs_gan import utils
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ import collections
|
|||||||
import math
|
import math
|
||||||
|
|
||||||
import sonnet as snt
|
import sonnet as snt
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
|
|
||||||
from cs_gan import utils
|
from cs_gan import utils
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ import os
|
|||||||
from absl import app
|
from absl import app
|
||||||
from absl import flags
|
from absl import flags
|
||||||
from absl import logging
|
from absl import logging
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
|
|
||||||
from cs_gan import file_utils
|
from cs_gan import file_utils
|
||||||
from cs_gan import gan
|
from cs_gan import gan
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ from absl import app
|
|||||||
from absl import flags
|
from absl import flags
|
||||||
from absl import logging
|
from absl import logging
|
||||||
|
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
import tensorflow_probability as tfp
|
import tensorflow_probability as tfp
|
||||||
|
|
||||||
from cs_gan import cs
|
from cs_gan import cs
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ import functools
|
|||||||
import re
|
import re
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import sonnet as snt
|
import sonnet as snt
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
import tensorflow_gan as tfgan
|
import tensorflow_gan as tfgan
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
|
|
||||||
import sonnet as snt
|
import sonnet as snt
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
|
|
||||||
from cs_gan import gan
|
from cs_gan import gan
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ import os
|
|||||||
|
|
||||||
from absl import logging
|
from absl import logging
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
import tensorflow_probability as tfp
|
import tensorflow_probability as tfp
|
||||||
|
|
||||||
from cs_gan import nets
|
from cs_gan import nets
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
from absl import logging
|
from absl import logging
|
||||||
import sonnet as snt
|
import sonnet as snt
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
|
|
||||||
tfc = tf.compat.v1
|
tfc = tf.compat.v1
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@
|
|||||||
from absl import logging
|
from absl import logging
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import sonnet as snt
|
import sonnet as snt
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
import tensorflow_probability as tfp
|
import tensorflow_probability as tfp
|
||||||
|
|
||||||
from curl import layers
|
from curl import layers
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ from absl import logging
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
from sklearn import neighbors
|
from sklearn import neighbors
|
||||||
import sonnet as snt
|
import sonnet as snt
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
import tensorflow_datasets as tfds
|
import tensorflow_datasets as tfds
|
||||||
import tensorflow_probability as tfp
|
import tensorflow_probability as tfp
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ from __future__ import division
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
from absl import logging
|
from absl import logging
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
import tensorflow_probability as tfp
|
import tensorflow_probability as tfp
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ from __future__ import print_function
|
|||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import sonnet as snt
|
import sonnet as snt
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
|
|
||||||
|
|
||||||
class MovingAverage(snt.AbstractModule):
|
class MovingAverage(snt.AbstractModule):
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ from __future__ import division
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
from model import HierarchicalProbUNet
|
from model import HierarchicalProbUNet
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
|
|
||||||
|
|
||||||
_NUM_CLASSES = 2
|
_NUM_CLASSES = 2
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ from __future__ import division
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import sonnet as snt
|
import sonnet as snt
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
|
|
||||||
|
|
||||||
def res_block(input_features, n_channels, n_down_channels=None,
|
def res_block(input_features, n_channels, n_down_channels=None,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ from __future__ import print_function
|
|||||||
import functools
|
import functools
|
||||||
|
|
||||||
import sonnet as snt
|
import sonnet as snt
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
from tensorflow.contrib import framework as contrib_framework
|
from tensorflow.contrib import framework as contrib_framework
|
||||||
from tensorflow.contrib import layers as contrib_layers
|
from tensorflow.contrib import layers as contrib_layers
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ from __future__ import division
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
from absl.testing import parameterized
|
from absl.testing import parameterized
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
from transporter import transporter
|
from transporter import transporter
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ from __future__ import division
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import six
|
import six
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
|
|
||||||
|
|
||||||
def sum_time_average_batch(tensor, name=None):
|
def sum_time_average_batch(tensor, name=None):
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@ from absl import logging
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
from six.moves import range
|
from six.moves import range
|
||||||
from six.moves import zip
|
from six.moves import zip
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
|
|
||||||
from tvt import batch_env
|
from tvt import batch_env
|
||||||
from tvt import nest_utils
|
from tvt import nest_utils
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ from __future__ import print_function
|
|||||||
import collections
|
import collections
|
||||||
|
|
||||||
import sonnet as snt
|
import sonnet as snt
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
|
|
||||||
ReadInformation = collections.namedtuple(
|
ReadInformation = collections.namedtuple(
|
||||||
'ReadInformation', ('weights', 'indices', 'keys', 'strengths'))
|
'ReadInformation', ('weights', 'indices', 'keys', 'strengths'))
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@ import numpy as np
|
|||||||
from six.moves import range
|
from six.moves import range
|
||||||
from six.moves import zip
|
from six.moves import zip
|
||||||
import sonnet as snt
|
import sonnet as snt
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
import trfl
|
import trfl
|
||||||
|
|
||||||
from tvt import losses
|
from tvt import losses
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
import tensorflow_hub as hub
|
import tensorflow_hub as hub
|
||||||
from unrestricted_advex import eval_kit
|
from unrestricted_advex import eval_kit
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ from absl import flags
|
|||||||
import cleverhans
|
import cleverhans
|
||||||
from cleverhans import attacks
|
from cleverhans import attacks
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import tensorflow as tf
|
import tensorflow.compat.v1 as tf
|
||||||
from tensorflow.python.ops import math_grad
|
from tensorflow.python.ops import math_grad
|
||||||
import tensorflow_hub as hub
|
import tensorflow_hub as hub
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user