code: def test_rnn_accuracy(
      rnn_layer, return_sequences, backend, io_type, strategy, static
  ):
      # Subtract 0.5 to include negative values
      input_shape = (12, 8)
      X = np.random.rand(50, *input_shape) - 0.5
  
      layer_name = rnn_layer.__class__.__name__.lower()
      keras_model = Sequential()
      keras_model.add(
          rnn_layer(
              units=32,
              input_shape=input_shape,
              kernel_initializer="lecun_uniform",
              recurrent_initializer="lecun_uniform",
              bias_initializer="lecun_uniform",
              return_sequences=return_sequences,
              name=layer_name,
          )
      )
      keras_model.compile()
  
      default_precision = (
          "ap_fixed<32, 16>"
          if backend in ["Vivado", "Vitis"]
          else "ac_fixed<32, 16, true>"
      )
      hls_config = hls4ml.utils.config_from_keras_model(
          keras_model,
          granularity="name",
          default_precision=default_precision,
          backend=backend,
      )
      hls_config["LayerName"][layer_name]["static"] = static
      hls_config["LayerName"][layer_name]["Strategy"] = strategy
      prj_name = "hls4mlprj_rnn_accuracy_{}_static_{}_ret_seq_{}_{}_{}_{}".format(
          rnn_layer.__class__.__name__.lower(),
          int(static),
          int(return_sequences),
          backend,
          io_type,
          strategy,
      )
      output_dir = str(test_root_path / prj_name)
  
      hls_model = hls4ml.converters.convert_from_keras_model(
          keras_model,
          hls_config=hls_config,
          output_dir=output_dir,
          backend=backend,
          io_type=io_type,
      )
      hls_model.compile()
  
      keras_prediction = keras_model.predict(X)
      hls_prediction = hls_model.predict(X)
      np.testing.assert_allclose(
          hls_prediction.flatten(),
          keras_prediction.flatten(),
          rtol=0.0,
          atol=5e-2,
      )
  
file_path: hls4ml/test/pytest/test_rnn.py
imports: from pathlib import Path
  import numpy
  import pytest
  from tensorflow.keras.layers import GRU, LSTM, Input, SimpleRNN
  from tensorflow.keras.models import Model, Sequential
  import hls4ml
label_desc: Use image node_id 2 for calling a global function with example usage: test_rnn_accuracy(rnn_layer, return_sequences, backend, io_type, strategy, static) without return types