Skip to content

Commit

Permalink
[TF FE] Stabilize TF2 Keras layer test for StackedRNNCells (openvinot…
Browse files Browse the repository at this point in the history
…oolkit#26329)

**Details:** Stabilize TF2 Keras layer test for StackedRNNCells

**Ticket:** TBD

Signed-off-by: Kazantsev, Roman <[email protected]>
  • Loading branch information
rkazants authored Aug 30, 2024
1 parent 19eb02f commit aa4d550
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down

0 comments on commit aa4d550

Please sign in to comment.