code: def gen_inputs(inputs, latent_type_size):
      batch_size = len(inputs["data_id"])
      new_bsz = batch_size * latent_type_size
      inputs = {
          name: repeat_array(array, latent_type_size)
          for name, array in inputs.items()
      }
      # Add latent_id
      inputs["latent_id"] = np.array(
          [
              i
              for i in range(latent_type_size)
              for _ in range(batch_size)
          ],
          dtype="int64",
      ).reshape([-1, 1])
  
      # print('\nplato_inputs:')
      for key in inputs:
          inputs[key] = paddle.to_tensor(inputs[key])
          if key in [
              "token_ids",
              "type_ids",
              "pos_ids",
              "tgt_ids",
              "tgt_pos",
              "data_id",
          ]:
              inputs[key] = paddle.squeeze(inputs[key], axis=-1)
          # print(key, inputs[key].shape, inputs[key].dtype)
      return inputs
  
imports: from itertools import chain
  import numpy
  import paddle
label_desc: Use image node_id 2 for calling a global function with example usage: gen_inputs(inputs, latent_type_size) and returns: inputs