Skip to content

Commit

Permalink
Explicitly replace "import tensorflow" with "tensorflow.compat.v1"
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 286199180
  • Loading branch information
Google AI Team authored and albert-copybara committed Dec 18, 2019
1 parent cf62c25 commit e8f8339
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion classifier_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import modeling
import optimization
import tokenization
import tensorflow as tf
import tensorflow.compat.v1 as tf
from tensorflow.contrib import data as contrib_data
from tensorflow.contrib import metrics as contrib_metrics
from tensorflow.contrib import tpu as contrib_tpu
Expand Down
2 changes: 1 addition & 1 deletion lamb_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import re
import six
import tensorflow as tf
import tensorflow.compat.v1 as tf

# pylint: disable=g-direct-tensorflow-import
from tensorflow.python.ops import array_ops
Expand Down
2 changes: 1 addition & 1 deletion modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import numpy as np
import six
from six.moves import range
import tensorflow as tf
import tensorflow.compat.v1 as tf
from tensorflow.contrib import layers as contrib_layers


Expand Down
2 changes: 1 addition & 1 deletion modeling_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import modeling
import six
from six.moves import range
import tensorflow as tf
import tensorflow.compat.v1 as tf


class AlbertModelTest(tf.test.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import lamb_optimizer
import six
from six.moves import zip
import tensorflow as tf
import tensorflow.compat.v1 as tf
from tensorflow.contrib import tpu as contrib_tpu


Expand Down
2 changes: 1 addition & 1 deletion optimization_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import optimization
from six.moves import range
from six.moves import zip
import tensorflow as tf
import tensorflow.compat.v1 as tf


class OptimizationTest(tf.test.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion squad_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import six
from six.moves import map
from six.moves import range
import tensorflow as tf
import tensorflow.compat.v1 as tf
from tensorflow.contrib import data as contrib_data
from tensorflow.contrib import layers as contrib_layers
from tensorflow.contrib import tpu as contrib_tpu
Expand Down
2 changes: 1 addition & 1 deletion tokenization.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import unicodedata
import six
from six.moves import range
import tensorflow as tf
import tensorflow.compat.v1 as tf
import sentencepiece as spm

SPIECE_UNDERLINE = u"▁".encode("utf-8")
Expand Down
2 changes: 1 addition & 1 deletion tokenization_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import tempfile
import tokenization
import six
import tensorflow as tf
import tensorflow.compat.v1 as tf


class TokenizationTest(tf.test.TestCase):
Expand Down

0 comments on commit e8f8339

Please sign in to comment.