code: def multi_pred(
      exe,
      gw,
      gf,
      program,
      y_pred,
      seq,
      batch_size,
      n_his,
      n_pred,
      step_idx,
      dynamic_batch=True,
  ):
      """multi step prediction"""
      pred_list = []
      for i in gen_batch(
          seq, min(batch_size, len(seq)), dynamic_batch=dynamic_batch
      ):
          # Note: use np.copy() to avoid the modification of source data.
          test_seq = np.copy(i[:, 0 : n_his + 1, :, :]).astype(
              np.float32
          )
          graph = gf.build_graph(i[:, 0:n_his, :, :])
          feed = gw.to_feed(graph)
          step_list = []
          for j in range(n_pred):
              feed["input"] = test_seq
              pred = exe.run(program, feed=feed, fetch_list=[y_pred])
              if isinstance(pred, list):
                  pred = np.array(pred[0])
              test_seq[:, 0 : n_his - 1, :, :] = test_seq[
                  :, 1:n_his, :, :
              ]
              test_seq[:, n_his - 1, :, :] = pred
              step_list.append(pred)
          pred_list.append(step_list)
      #  pred_array -> [n_pred, len(seq), n_route, C_0)
      pred_array = np.concatenate(pred_list, axis=1)
      return pred_array, pred_array.shape[1]
  
file_path: PGL/legacy/examples/stgcn/models/tester.py
imports: import os
  import sys
  import time
  import argparse
  import numpy
  import pandas
  import paddle.fluid
  import paddle.fluid.layers
  import pgl
  from pgl.utils.logger import log
  from data_loader.data_utils import gen_batch
  from utils.math_utils import evaluation
label_desc: Use image node_id 1 for calling a global function with example usage: multi_pred(exe, gw, gf, program, y_pred, seq, batch_size, n_his, n_pred, step_idx, dynamic_batch) and returns: pred_array,  pred_array