code: def test_rnn(
      *,
      rnn_args,
      test_flags,
      backend_fw,
      fn_name,
      on_device,
  ):
      # ToDo : Get the tests passing with paddle
      (
          input_dtypes,
          inputs,
          kernel_orig,
          recurrent_kernel_orig,
          bias_orig,
          recurrent_bias_orig,
          initial_states,
          go_backwards,
          mask,
          unroll,
          input_length,
          time_major,
          zero_output_for_mask,
          return_all_outputs,
      ) = rnn_args
  
      # unsupported dtype of float16 is in our _lstm_step function
      # so can't be inferred through ivy.function_unsupported_devices_and_dtypes
      assume(
          not (backend_fw == "torch" and input_dtypes[0] == "float16")
      )
  
      def _lstm_step(cell_inputs, cell_states):
          with BackendHandler.update_backend(
              ivy.current_backend(
                  cell_inputs.to_native()
                  if "ivy" in str(type(cell_inputs))
                  else cell_inputs
              ).backend
          ) as ivy_backend:
              nonlocal kernel_orig, recurrent_kernel_orig, bias_orig, recurrent_bias_orig
              kernel = ivy_backend.array(kernel_orig)
              recurrent_kernel = ivy_backend.array(
                  recurrent_kernel_orig
              )
              bias = ivy_backend.array(bias_orig)
              recurrent_bias = ivy_backend.array(recurrent_bias_orig)
  
              h_tm1 = cell_states[0]  # previous memory state
              c_tm1 = cell_states[1]  # previous carry state
  
              z = ivy_backend.dot(cell_inputs, kernel) + bias
              z += (
                  ivy_backend.dot(h_tm1, recurrent_kernel)
                  + recurrent_bias
              )
  
              z0, z1, z2, z3 = ivy_backend.split(
                  z, num_or_size_splits=4, axis=-1
              )
  
              i = ivy_backend.sigmoid(z0)  # input
              f = ivy_backend.sigmoid(z1)  # forget
              c = f * c_tm1 + i * ivy_backend.tanh(z2)
              o = ivy_backend.sigmoid(z3)  # output
  
              h = o * ivy_backend.tanh(c)
              return h, [h, c]
  
      helpers.test_function(
          input_dtypes=input_dtypes,
          test_flags=test_flags,
          backend_to_test=backend_fw,
          on_device=on_device,
          fn_name=fn_name,
          rtol_=1e-1,
          atol_=1e-1,
          step_function=_lstm_step,
          inputs=inputs,
          initial_states=initial_states,
          go_backwards=go_backwards,
          mask=mask,
          constants=None,
          unroll=unroll,
          input_length=input_length,
          time_major=time_major,
          zero_output_for_mask=zero_output_for_mask,
          return_all_outputs=return_all_outputs,
      )
  
imports: import numpy
  import torch
  from hypothesis import strategies, assume
  import ivy
  import ivy_tests.test_ivy.helpers
  from ivy_tests.test_ivy.helpers import handle_test, BackendHandler
label_desc: Use image node_id 39 for calling a global function with example usage: test_rnn() and returns: h,  list