code: def resample(input, size, align_corners=True):
      n, c, h, w = input.shape
      dh, dw = size
  
      input = input.reshape([n * c, 1, h, w])
  
      if dh < h:
          kernel_h = lanczos(ramp(dh / h, 2), 2).to(
              input.device, input.dtype
          )
          pad_h = (kernel_h.shape[0] - 1) // 2
          input = F.pad(input, (0, 0, pad_h, pad_h), "reflect")
          input = F.conv2d(input, kernel_h[None, None, :, None])
  
      if dw < w:
          kernel_w = lanczos(ramp(dw / w, 2), 2).to(
              input.device, input.dtype
          )
          pad_w = (kernel_w.shape[0] - 1) // 2
          input = F.pad(input, (pad_w, pad_w, 0, 0), "reflect")
          input = F.conv2d(input, kernel_w[None, None, None, :])
  
      input = input.reshape([n, c, h, w])
      return F.interpolate(
          input, size, mode="bicubic", align_corners=align_corners
      )
  
file_path: PaddleHub/modules/image/text_to_image/disco_diffusion_ernievil_base/reverse_diffusion/model/make_cutouts.py
imports: import math
  import paddle
  import paddle.nn
  from disco_diffusion_ernievil_base.resize_right.resize_right import resize
  from paddle.nn import functional
  from .None import transforms
label_desc: Use image node_id 4 for calling a global function with example usage: resample(input, size, align_corners) and returns: F