code: def test_inference_backward(
      num_layers,
      bidirectional,
      seq_len,
      batch_size,
      input_size,
      hidden_size,
      ctx,
      func_name,
  ):
      with nn.context_scope(ctx):
          num_directions = 1
          if bidirectional:
              num_directions = 2
  
          x = nn.Variable(
              (seq_len, batch_size, input_size), need_grad=True
          )
          h = nn.Variable(
              (num_layers, num_directions, batch_size, hidden_size),
              need_grad=True,
          )
          w0 = nn.Variable(
              (
                  num_directions,
                  3,
                  hidden_size,
                  input_size + hidden_size,
              ),
              need_grad=True,
          )
          w = nn.Variable(
              (
                  max(1, num_layers - 1),
                  num_directions,
                  3,
                  hidden_size,
                  num_directions * hidden_size + hidden_size,
              ),
              need_grad=True,
          )
          b = nn.Variable(
              (num_layers, num_directions, 4, hidden_size),
              need_grad=True,
          )
          y, hn = F.gru(
              x, h, w0, w, b, num_layers=num_layers, training=False
          )
          y.forward()
      with pytest.raises(RuntimeError) as e_info:
          y.backward()
  
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 5 for calling a global function with example usage: test_inference_backward(num_layers, bidirectional, seq_len, batch_size, input_size, hidden_size, ctx, func_name) without return types