code: def test_gru_double_backward(
      seed,
      num_layers,
      dropout,
      bidirectional,
      training,
      seq_len,
      batch_size,
      input_size,
      hidden_size,
      with_bias,
      ctx,
      func_name,
  ):
      from nbla_test_utils import backward_function_tester
  
      with nn.context_scope(ctx):
          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
              )
              * 0.1
          ]
          inputs += [
              rng.randn(
                  num_layers, num_directions, batch_size, hidden_size
              ).astype(np.float32)
          ]
          inputs += [
              rng.randn(
                  num_directions,
                  3,
                  hidden_size,
                  input_size + hidden_size,
              )
          ]
          if num_layers > 1:
              inputs += [
                  rng.randn(
                      max(1, num_layers - 1),
                      num_directions,
                      3,
                      hidden_size,
                      num_directions * hidden_size + hidden_size,
                  ).astype(np.float32)
              ]
          else:
              inputs += [None]
          if with_bias:
              inputs += [
                  rng.randn(
                      num_layers, num_directions, 4, hidden_size
                  ).astype(np.float32)
              ]
          else:
              inputs += [None]
  
          backward = [False for _ in inputs]
          if training:
              backward = [True for _ in inputs]
  
          backward_function_tester(
              rng,
              F.gru,
              inputs,
              func_kwargs=dict(
                  num_layers=num_layers,
                  dropout=dropout,
                  bidirectional=bidirectional,
                  training=training,
              ),
              atol_f=1e-6,
              dstep=1e-3,
              backward=backward,
              ctx=ctx,
              skip_backward_check=True,
          )
  
file_path: nnabla/python/test/function/test_gru.py
imports: import pytest
  import numpy
  import nnabla
  import nnabla.functions
  from nnabla.utils.rnn import _create_fixed_length_gru
  from nbla_test_utils import list_context
label_desc: Use image node_id 4 for calling a global function with example usage: test_gru_double_backward(seed, num_layers, dropout, bidirectional, training, seq_len, batch_size, input_size, hidden_size, with_bias, ctx, func_name) without return types