code: def _test_forward_with_tuple_input(self, gpu):
      in_size = 5
      out_size = 3
  
      def concat_input(tensors):
          return torch.cat(tensors, dim=1)
  
      rseq = RecurrentSequential(
          Lambda(concat_input),
          nn.RNN(
              num_layers=1, input_size=in_size, hidden_size=out_size
          ),
      )
  
      if gpu >= 0:
          device = torch.device("cuda:{}".format(gpu))
          rseq.to(device)
      else:
          device = torch.device("cpu")
  
      # Input is list of tuples. Each tuple has two variables.
      seqs_x = [
          (
              torch.rand(3, 2, device=device),
              torch.rand(3, 3, device=device),
          ),
          (
              torch.rand(1, 2, device=device),
              torch.rand(1, 3, device=device),
          ),
      ]
      packed_x = (
          nn.utils.rnn.pack_sequence([seqs_x[0][0], seqs_x[1][0]]),
          nn.utils.rnn.pack_sequence([seqs_x[0][1], seqs_x[1][1]]),
      )
  
      # Concatenated output should be a variable.
      out, _ = rseq(packed_x, None)
      self.assertEqual(out.data.shape, (4, out_size))
  
file_path: pfrl/tests/nn_tests/test_recurrent_sequential.py
imports: import unittest
  import pytest
  import torch
  import torch.nn.functional
  from torch import nn
  from pfrl.nn import Lambda, RecurrentSequential
  from pfrl.testing import torch_assert_allclose
label_desc: Use image node_id 4 for calling the TestRecurrentSequential obj's underlying member method code with example usage: obj._test_forward_with_tuple_input(gpu) and returns: torch