OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[TF FE] Stabilize TF2 Keras layer test for StackedRNNCells (#26329)
Roman Kazantsevaa4d55082110
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.pyindex 1d1c1f8da20..416e52b4dc0 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 npimport pytestimport 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 = {