code: def test_pack_padded_sequence_forward_backward(
      batch_first, shapes, seed, ctx, func_name
  ):
      from nbla_test_utils import function_tester
  
      rng = np.random.RandomState(seed)
  
      sequences = [
          rng.randn(*shape).astype(np.float32) for shape in shapes
      ]
      padded_sequence = pad_sequence(sequences, batch_first)
      lengths = np.array([seq.shape[0] for seq in sequences])
      inputs = [padded_sequence, lengths]
      func_args = [batch_first]
      insert_identity = [True, False]
  
      function_tester(
          rng,
          F.pack_padded_sequence,
          ref_pack_padded_sequence,
          inputs,
          ctx=ctx,
          func_name=func_name,
          func_args=func_args,
          backward=[True, False],
          disable_half_test=False,
          atol_f=1e-3,
          atol_b=1e-2,
          insert_identity=insert_identity,
      )
  
file_path: nnabla/python/test/function/test_pack_padded_sequence.py
imports: import pytest
  import numpy
  import nnabla.functions
  from nbla_test_utils import list_context
  from refs import pad_sequence
label_desc: Use image node_id 3 for calling a global function with example usage: test_pack_padded_sequence_forward_backward(batch_first, shapes, seed, ctx, func_name) without return types