Minor change in update script
PiperOrigin-RevId: 297221831 Change-Id: Ibc864c21ad7bd277ffe00caecb9751629f89d97b
This commit is contained in:
parent
78b9c0aa02
commit
5de7e810ab
@ -47,19 +47,12 @@ class TFAPIChangeSpec(ast_edits.APIChangeSpec):
|
|||||||
|
|
||||||
# List module renames. If changed, please update max_submodule_depth.
|
# List module renames. If changed, please update max_submodule_depth.
|
||||||
self.import_renames = {
|
self.import_renames = {
|
||||||
"tensorflow.google":
|
|
||||||
ast_edits.ImportRename(
|
|
||||||
"tensorflow.google.compat.v1",
|
|
||||||
excluded_prefixes=[
|
|
||||||
"tensorflow.google.compat.v1",
|
|
||||||
"tensorflow.google.compat.v2",
|
|
||||||
],
|
|
||||||
),
|
|
||||||
"tensorflow":
|
"tensorflow":
|
||||||
ast_edits.ImportRename(
|
ast_edits.ImportRename(
|
||||||
"tensorflow.compat.v1",
|
"tensorflow.compat.v1",
|
||||||
excluded_prefixes=[
|
excluded_prefixes=[
|
||||||
"tensorflow.contrib", "tensorflow.flags",
|
"tensorflow.contrib", "tensorflow.flags",
|
||||||
|
"tensorflow.compat",
|
||||||
"tensorflow.compat.v1", "tensorflow.compat.v2",
|
"tensorflow.compat.v1", "tensorflow.compat.v2",
|
||||||
"tensorflow.google"
|
"tensorflow.google"
|
||||||
],
|
],
|
||||||
|
@ -70,14 +70,12 @@ class TfUpgradeV2SafetyTest(test_util.TensorFlowTestCase):
|
|||||||
|
|
||||||
def testTensorFlowGoogleImport(self):
|
def testTensorFlowGoogleImport(self):
|
||||||
text = "import tensorflow.google as tf"
|
text = "import tensorflow.google as tf"
|
||||||
expected_text = "import tensorflow.google.compat.v1 as tf"
|
|
||||||
_, _, _, new_text = self._upgrade(text)
|
_, _, _, new_text = self._upgrade(text)
|
||||||
self.assertEqual(expected_text, new_text)
|
self.assertEqual(text, new_text)
|
||||||
|
|
||||||
text = "import tensorflow.google"
|
text = "import tensorflow.google"
|
||||||
expected_text = "import tensorflow.google.compat.v1"
|
|
||||||
_, _, _, new_text = self._upgrade(text)
|
_, _, _, new_text = self._upgrade(text)
|
||||||
self.assertEqual(expected_text, new_text)
|
self.assertEqual(text, new_text)
|
||||||
|
|
||||||
text = "import tensorflow.google.compat.v1 as tf"
|
text = "import tensorflow.google.compat.v1 as tf"
|
||||||
expected_text = "import tensorflow.google.compat.v1 as tf"
|
expected_text = "import tensorflow.google.compat.v1 as tf"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user