From 5a18bc1277f30a1219e20973663595db740676f7 Mon Sep 17 00:00:00 2001 From: Roman Kazantsev Date: Mon, 22 Apr 2024 01:23:24 +0400 Subject: [PATCH] [TF FE] Extend StringSplitV2 layer tests and fix warnings (#24148) **Details:** Extend StringSplitV2 layer tests and fix warnings. Merge after https://github.com/openvinotoolkit/openvino_tokenizers/pull/121 **Ticket:** TBD --------- Signed-off-by: Kazantsev, Roman --- tests/layer_tests/tensorflow_tests/test_tf_Equal.py | 2 +- .../tensorflow_tests/test_tf_StaticRegexReplace.py | 2 +- tests/layer_tests/tensorflow_tests/test_tf_StringSplitV2.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/layer_tests/tensorflow_tests/test_tf_Equal.py b/tests/layer_tests/tensorflow_tests/test_tf_Equal.py index de35f9fe3a901d..fa39468302c6f0 100644 --- a/tests/layer_tests/tensorflow_tests/test_tf_Equal.py +++ b/tests/layer_tests/tensorflow_tests/test_tf_Equal.py @@ -223,7 +223,7 @@ def _prepare_input(self, inputs_info): x_shape = inputs_info['x:0'] y_shape = inputs_info['y:0'] inputs_data = {} - strings_dictionary = ['UPPER<>CASE SENTENCE', 'lower case\n\s sentence', ' UppEr LoweR CAse SENtence \t\n', + strings_dictionary = ['UPPER<>CASE SENTENCE', 'lower case\n sentence', ' UppEr LoweR CAse SENtence \t\n', ' some sentence', 'another sentence HERE '] inputs_data['x:0'] = rng.choice(strings_dictionary, x_shape) inputs_data['y:0'] = rng.choice(strings_dictionary, y_shape) diff --git a/tests/layer_tests/tensorflow_tests/test_tf_StaticRegexReplace.py b/tests/layer_tests/tensorflow_tests/test_tf_StaticRegexReplace.py index 78d946a44a0bc8..ef5e135537eb84 100644 --- a/tests/layer_tests/tensorflow_tests/test_tf_StaticRegexReplace.py +++ b/tests/layer_tests/tensorflow_tests/test_tf_StaticRegexReplace.py @@ -36,7 +36,7 @@ def create_static_regex_replace_net(self, input_shape, pattern, rewrite, replace return tf_net, ref_net @pytest.mark.parametrize('input_shape', [[], [2], [3, 4], [1, 3, 2]]) - @pytest.mark.parametrize('pattern', ['(\s)|(-)', '[A-Z]{2,}', '^\s+|\s+$']) + @pytest.mark.parametrize('pattern', [r'(\s)|(-)', r'[A-Z]{2,}', r'^\s+|\s+$']) @pytest.mark.parametrize('rewrite', ['', 'replacement word']) @pytest.mark.parametrize('replace_global', [None, True, False]) @pytest.mark.precommit diff --git a/tests/layer_tests/tensorflow_tests/test_tf_StringSplitV2.py b/tests/layer_tests/tensorflow_tests/test_tf_StringSplitV2.py index 2161d5580969e1..3745d07926bc43 100644 --- a/tests/layer_tests/tensorflow_tests/test_tf_StringSplitV2.py +++ b/tests/layer_tests/tensorflow_tests/test_tf_StringSplitV2.py @@ -17,7 +17,7 @@ def _prepare_input(self, inputs_info): assert 'input:0' in inputs_info input_shape = inputs_info['input:0'] inputs_data = {} - strings_dictionary = ['UPPER<>CASE SENTENCE', 'lower case\n\s sentence', ' UppEr LoweR CAse SENtence \t\n', + strings_dictionary = ['UPPER<>CASE SENTENCE', 'lower case\n sentence', ' UppEr LoweR CAse SENtence \t\n', ' some sentence', 'another sentence HERE '] inputs_data['input:0'] = rng.choice(strings_dictionary, input_shape) return inputs_data @@ -39,7 +39,7 @@ def create_string_split_v2_net(self, input_shape, sep, maxsplit): @pytest.mark.parametrize('input_shape', [[1], [2], [5]]) @pytest.mark.parametrize('sep', ['', '<>']) - @pytest.mark.parametrize('maxsplit', [None, -1]) + @pytest.mark.parametrize('maxsplit', [None, -1, 5, 10]) @pytest.mark.precommit @pytest.mark.nightly @pytest.mark.xfail(condition=platform.system() in ('Darwin', 'Linux') and platform.machine() in ['arm', 'armv7l',