code: def test_pf_rnn_execution(
      g_rng,
      inshape,
      w0_init,
      w_init,
      b_init,
      num_layers,
      nonlinearity,
      dropout,
      bidirectional,
      with_bias,
      hidden_size,
      training,
      fix_parameters,
      rng,
      ctx,
      func_name,
  ):
      with nn.context_scope(ctx):
          if func_name == "RNN":
              pytest.skip("Not implemented in CPU.")
  
          num_directions = 2 if bidirectional else 1
          w0_shape = (
              num_directions,
              hidden_size,
              inshape[2] + hidden_size,
          )
          w_shape = (
              max(1, num_layers - 1),
              num_directions,
              hidden_size,
              num_directions * hidden_size + hidden_size,
          )
          b_shape = (num_layers, num_directions, hidden_size)
  
          w0_init = process_param_init(w0_init, w0_shape, g_rng)
          w_init = process_param_init(w_init, w_shape, g_rng)
          b_init = process_param_init(b_init, b_shape, g_rng)
          rng = process_rng(rng)
  
          kw = {}
          insert_if_not_none(kw, "w0_init", w0_init)
          insert_if_not_none(kw, "w_init", w_init)
          insert_if_not_none(kw, "b_init", b_init)
          insert_if_not_default(kw, "num_layers", num_layers, 1)
          insert_if_not_default(
              kw, "nonlinearity", nonlinearity, "tanh"
          )
          insert_if_not_default(kw, "dropout", dropout, 0.0)
          insert_if_not_default(
              kw, "bidirectional", bidirectional, False
          )
          insert_if_not_default(kw, "training", training, True)
          insert_if_not_none(kw, "rng", rng)
          insert_if_not_default(kw, "with_bias", with_bias, True)
          insert_if_not_default(
              kw, "fix_parameters", fix_parameters, False
          )
  
          x = nn.Variable.from_numpy_array(g_rng.randn(*inshape))
          h = nn.Variable.from_numpy_array(
              g_rng.randn(
                  *(num_layers, num_directions, inshape[1], hidden_size)
              )
          )
  
          # Check execution
          y, hn = PF.rnn(x, h, **kw)
          y.forward()
          if training:
              y.backward()
  
          # Check values
          # TODO
  
          # Check args
          assert y.parent.info.type_name == "RNN"
          args = y.parent.info.args
  
          # Check created parameters
          assert y.parent.inputs[0] == x
          assert y.parent.inputs[1] == h
          w0 = nn.get_parameters()["rnn/weight_l0"]
          assert w0.shape == w0_shape
          assert w0.need_grad
          assert y.parent.inputs[2].need_grad == (not fix_parameters)
          if isinstance(w0_init, np.ndarray):
              assert_allclose(w0_init, w0.d)
          if num_layers > 1:
              w = nn.get_parameters()["rnn/weight"]
              assert w.shape == w_shape
              assert w.need_grad
              assert y.parent.inputs[3].need_grad == (
                  not fix_parameters
              )
              if isinstance(w_init, np.ndarray):
                  assert_allclose(w_init, w.d)
          if with_bias:
              b = nn.get_parameters()["rnn/bias"]
              assert b.shape == b_shape
              assert b.need_grad
              if num_layers > 1:
                  assert y.parent.inputs[4].need_grad == (
                      not fix_parameters
                  )
              else:
                  assert y.parent.inputs[3].need_grad == (
                      not fix_parameters
                  )
              if isinstance(b_init, np.ndarray):
                  assert_allclose(b_init, b.d)
  
imports: import pytest
  import numpy
  import nnabla
  import nnabla.functions
  import nnabla.parametric_functions
  import nnabla.initializer
  from nnabla.testing import assert_allclose
  from nbla_test_utils import list_context
label_desc: Use image node_id 20 for calling a global function with example usage: test_pf_rnn_execution(g_rng, inshape, w0_init, w_init, b_init, num_layers, nonlinearity, dropout, bidirectional, with_bias, hidden_size, training, fix_parameters, rng, ctx, func_name) without return types