diff --git a/tensorflow/tools/compatibility/tf_upgrade_v2.py b/tensorflow/tools/compatibility/tf_upgrade_v2.py index 2c3d5651ab8..dcb5d556564 100644 --- a/tensorflow/tools/compatibility/tf_upgrade_v2.py +++ b/tensorflow/tools/compatibility/tf_upgrade_v2.py @@ -1832,8 +1832,8 @@ def _add_argument_transformer(parent, node, full_name, name, logs, node.keywords.append(ast.keyword(arg=arg_name, value=arg_value_ast)) logs.append(( ast_edits.INFO, node.lineno, node.col_offset, - "Adding argument '%s' to call to %s." % (pasta.dump(node.keywords[-1], - full_name or name)) + "Adding argument '%s' to call to %s." % (pasta.dump(node.keywords[-1]), + full_name or name) )) return node diff --git a/tensorflow/tools/compatibility/tf_upgrade_v2_test.py b/tensorflow/tools/compatibility/tf_upgrade_v2_test.py index a39baea1c04..080b4c93538 100644 --- a/tensorflow/tools/compatibility/tf_upgrade_v2_test.py +++ b/tensorflow/tools/compatibility/tf_upgrade_v2_test.py @@ -1566,6 +1566,12 @@ def _log_prob(self, x): _, _, _, new_text = self._upgrade(text) self.assertEqual(new_text, expected_text) + def testNnErosion2d(self): + text = "tf.nn.erosion2d(v, k, s, r, p)" + expected_text = "tf.nn.erosion2d(v, k, s, r, p, data_format='NHWC')" + _, _, _, new_text = self._upgrade(text) + self.assertEqual(new_text, expected_text) + class TestUpgradeFiles(test_util.TensorFlowTestCase):