code: def convert_batch(
      batch,
      backend="pytorch",
      is_cuda=False,
      idim=2,
      odim=2,
      num_inputs=2,
  ):
      ilens_list = [
          np.array([x[1]["input"][idx]["shape"][0] for x in batch])
          for idx in range(num_inputs)
      ]
      olens = np.array([x[1]["output"][0]["shape"][0] for x in batch])
      xs_list = [
          [
              np.random.randn(ilen, idim).astype(np.float32)
              for ilen in ilens_list[idx]
          ]
          for idx in range(num_inputs)
      ]
      ys = [
          np.random.randint(1, odim, olen).astype(np.int32)
          for olen in olens
      ]
      is_pytorch = backend == "pytorch"
      if is_pytorch:
          xs_list = [
              pad_list(
                  [torch.from_numpy(x).float() for x in xs_list[idx]], 0
              )
              for idx in range(num_inputs)
          ]
          ilens_list = [
              torch.from_numpy(ilens_list[idx]).long()
              for idx in range(num_inputs)
          ]
          ys = pad_list([torch.from_numpy(y).long() for y in ys], -1)
  
          if is_cuda:
              xs_list = [
                  xs_list[idx].cuda() for idx in range(num_inputs)
              ]
              ilens_list = [
                  ilens_list[idx].cuda() for idx in range(num_inputs)
              ]
              ys = ys.cuda()
  
      return xs_list, ilens_list, ys
  
imports: from __future__ import division
  import argparse
  import importlib
  import os
  import tempfile
  from test.utils_test import make_dummy_json
  import numpy
  import pytest
  import torch
  from espnet.nets.pytorch_backend.nets_utils import pad_list
  from espnet.utils.training.batchfy import make_batchset
label_desc: Use image node_id 3 for calling a global function with example usage: convert_batch(batch, backend, is_cuda, idim, odim, num_inputs) and returns: xs_list,  ilens_list,  ys