code: def pytorch_prepare_inputs(idim, odim, ilens, olens, is_cuda=False):
      np.random.seed(1)
  
      xs = [
          np.random.randn(ilen, idim).astype(np.float32)
          for ilen in ilens
      ]
      ys = [
          np.random.randint(1, odim, olen).astype(np.int32)
          for olen in olens
      ]
      ilens = np.array([x.shape[0] for x in xs], dtype=np.int32)
  
      xs_pad = pad_list([torch.from_numpy(x).float() for x in xs], 0)
      ys_pad = pad_list([torch.from_numpy(y).long() for y in ys], -1)
      ilens = torch.from_numpy(ilens).long()
  
      if is_cuda:
          xs_pad = xs_pad.cuda()
          ys_pad = ys_pad.cuda()
          ilens = ilens.cuda()
  
      return xs_pad, ilens, ys_pad
  
file_path: espnet/test/test_asr_init.py
imports: import argparse
  import json
  import os
  import tempfile
  import numpy
  import pytest
  import torch
  import espnet.nets.pytorch_backend.lm.default
  from espnet.asr.asr_utils import torch_save
  from espnet.asr.pytorch_backend.asr_init import freeze_modules, load_trained_modules
  from espnet.nets.beam_search_transducer import BeamSearchTransducer
  from espnet.nets.pytorch_backend.nets_utils import pad_list
label_desc: Use image node_id 5 for calling a global function with example usage: pytorch_prepare_inputs(idim, odim, ilens, olens, is_cuda) and returns: xs_pad,  ilens,  ys_pad