code: def prepare_inputs(
      idim,
      odim,
      ilens,
      olens,
      spk_embed_dim=None,
      device=torch.device("cpu"),
  ):
      xs = [np.random.randn(lg, idim) for lg in ilens]
      ys = [np.random.randn(lg, odim) for lg in olens]
      ilens = torch.LongTensor(ilens).to(device)
      olens = torch.LongTensor(olens).to(device)
      xs = pad_list([torch.from_numpy(x).float() for x in xs], 0).to(
          device
      )
      ys = pad_list([torch.from_numpy(y).float() for y in ys], 0).to(
          device
      )
      labels = ys.new_zeros(ys.size(0), ys.size(1))
      for i, l in enumerate(olens):
          labels[i, l - 1 :] = 1
      batch = {
          "xs": xs,
          "ilens": ilens,
          "ys": ys,
          "labels": labels,
          "olens": olens,
      }
  
      if spk_embed_dim is not None:
          batch["spembs"] = torch.FloatTensor(
              np.random.randn(len(ilens), spk_embed_dim)
          ).to(device)
  
      return batch
  
file_path: espnet/test/test_e2e_vc_transformer.py
imports: from argparse import Namespace
  from math import floor
  import numpy
  import pytest
  import torch
  from espnet.nets.pytorch_backend.e2e_vc_transformer import Transformer, subsequent_mask
  from espnet.nets.pytorch_backend.nets_utils import pad_list
label_desc: Use image node_id 3 for calling a global function with example usage: prepare_inputs(idim, odim, ilens, olens, spk_embed_dim, device) and returns: batch