Skip to content

Commit 06adf2a

Browse files
committed
unit test for reduce_join
Signed-off-by: Salvetti, Francesco <[email protected]>
1 parent 2b5caf1 commit 06adf2a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test_string_ops.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ def func(text1, text2, text3):
5252
return tf.identity(x_, name=_TFOUTPUT)
5353
self._run_test_case(func, [_OUTPUT], {_INPUT: text_val1, _INPUT1: text_val2, _INPUT2: text_val3})
5454

55+
@requires_custom_ops("ReduceJoin")
56+
def test_reduce_join(self):
57+
text_val = np.array([["a", "Test 1 2 3"], ["b", "test test"], ["c", "Hi there Test"]], dtype=np.str)
58+
def func(text):
59+
x_ = tf.strings.reduce_join(text, axis=1, separator="±")
60+
return tf.identity(x_, name=_TFOUTPUT)
61+
self._run_test_case(func, [_OUTPUT], {_INPUT: text_val})
62+
5563
@requires_custom_ops("StringSplit")
5664
@check_tf_min_version("2.0", "result is sparse not ragged in tf1")
5765
def test_string_split(self):

0 commit comments

Comments
 (0)