diff options
author | Jeremiah Harmsen <jeremiah@google.com> | 2018-09-12 08:23:00 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-09-12 08:27:21 -0700 |
commit | 6bf71666feb2184771ec3d0d304329b50a9a4ad2 (patch) | |
tree | 4e5b8ef9974379f1cc35b8f48e0122ad8a8317eb /tensorflow | |
parent | 5fe902531ec790ebd25618b7070b5094930f522e (diff) |
Remove compat.forward_compatible horizon checks for StaticRegexReplace.
PiperOrigin-RevId: 212642629
Diffstat (limited to 'tensorflow')
-rw-r--r-- | tensorflow/python/kernel_tests/regex_replace_op_test.py | 27 | ||||
-rw-r--r-- | tensorflow/python/ops/string_ops.py | 5 |
2 files changed, 12 insertions, 20 deletions
diff --git a/tensorflow/python/kernel_tests/regex_replace_op_test.py b/tensorflow/python/kernel_tests/regex_replace_op_test.py index f0e84b8fca..feac3a8b08 100644 --- a/tensorflow/python/kernel_tests/regex_replace_op_test.py +++ b/tensorflow/python/kernel_tests/regex_replace_op_test.py @@ -20,7 +20,6 @@ from __future__ import print_function from absl.testing import parameterized -from tensorflow.python.compat import compat from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.ops import gen_string_ops @@ -100,22 +99,20 @@ class RegexReplaceTest(test.TestCase, parameterized.TestCase): (as_tensor, as_string), (as_tensor, as_tensor)) def testRegexReplaceDelegation(self, pattern_fn, rewrite_fn): - with compat.forward_compatibility_horizon(2018, 10, 11): - with self.test_session(): - input_vector = constant_op.constant("foo", dtypes.string) - pattern = pattern_fn("[a-z]") - replace = rewrite_fn(".") - op = string_ops.regex_replace(input_vector, pattern, replace) - self.assertTrue(op.name.startswith("RegexReplace")) + with self.test_session(): + input_vector = constant_op.constant("foo", dtypes.string) + pattern = pattern_fn("[a-z]") + replace = rewrite_fn(".") + op = string_ops.regex_replace(input_vector, pattern, replace) + self.assertTrue(op.name.startswith("RegexReplace")) def testStaticRegexReplaceDelegation(self): - with compat.forward_compatibility_horizon(2018, 10, 11): - with self.test_session(): - input_vector = constant_op.constant("foo", dtypes.string) - pattern = "[a-z]" - replace = "." - op = string_ops.regex_replace(input_vector, pattern, replace) - self.assertTrue(op.name.startswith("StaticRegexReplace")) + with self.test_session(): + input_vector = constant_op.constant("foo", dtypes.string) + pattern = "[a-z]" + replace = "." + op = string_ops.regex_replace(input_vector, pattern, replace) + self.assertTrue(op.name.startswith("StaticRegexReplace")) if __name__ == "__main__": test.main() diff --git a/tensorflow/python/ops/string_ops.py b/tensorflow/python/ops/string_ops.py index 29fefbe3a5..b2c6937368 100644 --- a/tensorflow/python/ops/string_ops.py +++ b/tensorflow/python/ops/string_ops.py @@ -90,11 +90,6 @@ def regex_replace(source, pattern, rewrite, replace_global=True): Returns: string `Tensor` of the same shape as `source` with specified replacements. """ - # TODO(b/112455102): Remove compat.forward_compatible once past the horizon. - if not compat.forward_compatible(2018, 10, 10): - return gen_string_ops.regex_replace( - input=source, pattern=pattern, - rewrite=rewrite, replace_global=replace_global) if (isinstance(pattern, util_compat.bytes_or_text_types) and isinstance(rewrite, util_compat.bytes_or_text_types)): # When `pattern` and `rewrite` are static through the life of the op we can |