From aa4d55082110a2521922689f78755f0df9d469eb Mon Sep 17 00:00:00 2001 From: Roman Kazantsev Date: Fri, 30 Aug 2024 18:46:27 +0400 Subject: [PATCH] [TF FE] Stabilize TF2 Keras layer test for StackedRNNCells (#26329) **Details:** Stabilize TF2 Keras layer test for StackedRNNCells **Ticket:** TBD Signed-off-by: Kazantsev, Roman --- .../test_tf2_keras_stackedrnncells.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/layer_tests/tensorflow2_keras_tests/test_tf2_keras_stackedrnncells.py b/tests/layer_tests/tensorflow2_keras_tests/test_tf2_keras_stackedrnncells.py index 1d1c1f8da20589..416e52b4dc0c6a 100644 --- a/tests/layer_tests/tensorflow2_keras_tests/test_tf2_keras_stackedrnncells.py +++ b/tests/layer_tests/tensorflow2_keras_tests/test_tf2_keras_stackedrnncells.py @@ -1,13 +1,23 @@ # Copyright (C) 2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +import numpy as np import pytest import tensorflow as tf - from common.tf2_layer_test_class import CommonTF2LayerTest +rng = np.random.default_rng(23423556) + class TestKerasStackedRNNCells(CommonTF2LayerTest): + def _prepare_input(self, inputs_info): + input_names = list(inputs_info.keys()) + assert len(input_names) == 1, "Test expects only one input" + x_shape = inputs_info[input_names[0]] + inputs_data = {} + inputs_data[input_names[0]] = rng.uniform(-1.0, 1.0, x_shape).astype(np.float32) + return inputs_data + def create_keras_stackedrnncells_net(self, input_names, input_shapes, input_type, rnn_cells, ir_version): cells_structure = {