code: def reverse_transform(
      pred: paddle.Tensor, ori_shape: List[int], transforms: List[int]
  ) -> paddle.Tensor:
      """recover pred to origin shape"""
      reverse_list = get_reverse_list(ori_shape, transforms)
      for item in reverse_list[::-1]:
          if item[0] == "resize":
              h, w = item[1][0], item[1][1]
              pred = F.interpolate(pred, (h, w), mode="nearest")
          elif item[0] == "padding":
              h, w = item[1][0], item[1][1]
              pred = pred[:, :, 0:h, 0:w]
          else:
              raise Exception(
                  "Unexpected info '{}' in im_info".format(item[0])
              )
      return pred
  
imports: import os
  from typing import Callable, Union, List, Tuple
  import cv2
  import paddle
  import PIL
  import numpy
  import paddle.nn.functional
  from scipy.sparse import csr_matrix
label_desc: Use image node_id 14 for calling a global function with example usage: reverse_transform(pred, ori_shape, transforms) and returns: pred