From 3eee0f126c930c1c392cd56ef5e0e66f3c2d7b04 Mon Sep 17 00:00:00 2001 From: "Salvetti, Francesco" Date: Fri, 2 Dec 2022 13:49:54 -0500 Subject: [PATCH] unit test for reduce_join --- tests/test_string_ops.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_string_ops.py b/tests/test_string_ops.py index a78dd5c9f..7b164c030 100644 --- a/tests/test_string_ops.py +++ b/tests/test_string_ops.py @@ -52,6 +52,14 @@ def func(text1, text2, text3): return tf.identity(x_, name=_TFOUTPUT) self._run_test_case(func, [_OUTPUT], {_INPUT: text_val1, _INPUT1: text_val2, _INPUT2: text_val3}) + @requires_custom_ops("ReduceJoin") + def test_reduce_join(self): + text_val = np.array([["a", "Test 1 2 3"], ["b", "test test"], ["c", "Hi there Test"]], dtype=np.str) + def func(text): + x_ = tf.strings.reduce_join(text, axis=1, separator="±") + return tf.identity(x_, name=_TFOUTPUT) + self._run_test_case(func, [_OUTPUT], {_INPUT: text_val}) + @requires_custom_ops("StringSplit") @check_tf_min_version("2.0", "result is sparse not ragged in tf1") def test_string_split(self):