Skip to content

Commit aa4d550

Browse files
authored
[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 <roman.kazantsev@intel.com>
1 parent 19eb02f commit aa4d550

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/layer_tests/tensorflow2_keras_tests/test_tf2_keras_stackedrnncells.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
# Copyright (C) 2022 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33

4+
import numpy as np
45
import pytest
56
import tensorflow as tf
6-
77
from common.tf2_layer_test_class import CommonTF2LayerTest
88

9+
rng = np.random.default_rng(23423556)
10+
911

1012
class TestKerasStackedRNNCells(CommonTF2LayerTest):
13+
def _prepare_input(self, inputs_info):
14+
input_names = list(inputs_info.keys())
15+
assert len(input_names) == 1, "Test expects only one input"
16+
x_shape = inputs_info[input_names[0]]
17+
inputs_data = {}
18+
inputs_data[input_names[0]] = rng.uniform(-1.0, 1.0, x_shape).astype(np.float32)
19+
return inputs_data
20+
1121
def create_keras_stackedrnncells_net(self, input_names, input_shapes, input_type, rnn_cells,
1222
ir_version):
1323
cells_structure = {

0 commit comments

Comments
 (0)