code: def reverse_transform(pred, ori_shape, transforms):
      """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
  
file_path: PaddleSeg/contrib/AutoNUE/core/infer_ensemble.py
imports: import collections.abc
  from itertools import combinations
  import numpy
  import paddle
  import paddle.nn.functional
label_desc: Use image node_id 2 for calling a global function with example usage: reverse_transform(pred, ori_shape, transforms) and returns: pred