code: def reverse_transform(pred, trans_info, mode="nearest"):
      """recover pred to origin shape"""
      intTypeList = [
          paddle.int8,
          paddle.int16,
          paddle.int32,
          paddle.int64,
      ]
      dtype = pred.dtype
      for item in trans_info[::-1]:
          if isinstance(item[0], list):
              trans_mode = item[0][0]
          else:
              trans_mode = item[0]
          if trans_mode == "resize":
              h, w = item[1][0], item[1][1]
              if paddle.get_device() == "cpu" and dtype in intTypeList:
                  pred = paddle.cast(pred, "float32")
                  pred = F.interpolate(pred, [h, w], mode=mode)
                  pred = paddle.cast(pred, dtype)
              else:
                  pred = F.interpolate(pred, [h, w], mode=mode)
          elif trans_mode == "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
  
file_path: PaddleSeg/paddleseg/core/infer.py
imports: import collections.abc
  from itertools import combinations
  import numpy
  import cv2
  import paddle
  import paddle.nn.functional
label_desc: Use image node_id 1 for calling a global function with example usage: reverse_transform(pred, trans_info, mode) and returns: pred