code: def test_rnn(
      seed,
      num_layers,
      nonlinearity,
      dropout,
      bidirectional,
      training,
      seq_len,
      batch_size,
      input_size,
      hidden_size,
      with_bias,
      ctx,
      func_name,
  ):
      from nbla_test_utils import function_tester
  
      rng = np.random.RandomState(seed)
      num_directions = 1
      if bidirectional:
          num_directions = 2
      inputs = [
          rng.randn(seq_len, batch_size, input_size).astype(np.float32)
      ]
      inputs += [
          rng.randn(
              num_layers, num_directions, batch_size, hidden_size
          ).astype(np.float32)
      ]
      inputs += [
          rng.randn(
              num_directions, hidden_size, input_size + hidden_size
          )
      ]
      if num_layers > 1:
          inputs += [
              rng.randn(
                  max(1, num_layers - 1),
                  num_directions,
                  hidden_size,
                  num_directions * hidden_size + hidden_size,
              ).astype(np.float32)
          ]
      else:
          inputs += [None]
      if with_bias:
          inputs += [
              rng.randn(num_layers, num_directions, hidden_size).astype(
                  np.float32
              )
          ]
      else:
          inputs += [None]
  
      backward = [False for _ in inputs]
      if training:
          backward = [True for _ in inputs]
  
      function_tester(
          rng,
          F.rnn,
          execute_fixed_length_rnn,
          inputs,
          func_kwargs=dict(
              num_layers=num_layers,
              nonlinearity=nonlinearity,
              dropout=dropout,
              bidirectional=bidirectional,
              training=training,
          ),
          atol_f=2e-1,
          atol_b=2e-1,
          dstep=1e-3,
          backward=backward,
          ctx=ctx,
          func_name=func_name,
          ref_grad=get_rnn_grad,
          disable_half_test=True,
      )
  
file_path: nnabla/python/test/function/test_rnn.py
imports: import pytest
  import numpy
  import nnabla
  import nnabla.functions
  from nnabla.utils.rnn import _create_fixed_length_rnn
  from nbla_test_utils import list_context
label_desc: Use image node_id 3 for calling a global function with example usage: test_rnn(seed, num_layers, nonlinearity, dropout, bidirectional, training, seq_len, batch_size, input_size, hidden_size, with_bias, ctx, func_name) without return types