code: def evaluation(y, y_, x_stats):
      """Calculate MAPE, MAE and RMSE between ground truth and prediction."""
      dim = len(y_.shape)
  
      if dim == 3:
          # single_step case
          v = z_inverse(y, x_stats["mean"], x_stats["std"])
          v_ = z_inverse(y_, x_stats["mean"], x_stats["std"])
          return np.array([MAPE(v, v_), MAE(v, v_), RMSE(v, v_)])
      else:
          # multi_step case
          tmp_list = []
          # y -> [time_step, batch_size, n_route, 1]
          y = np.swapaxes(y, 0, 1)
          # recursively call
          for i in range(y_.shape[0]):
              tmp_res = evaluation(y[i], y_[i], x_stats)
              tmp_list.append(tmp_res)
          return np.concatenate(tmp_list, axis=-1)
  
file_path: PGL/legacy/examples/stgcn/utils/math_utils.py
imports: import os
  import sys
  import time
  import argparse
  import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: evaluation(y, y_, x_stats) and returns: np, np