code: def _get_upsampling_filter(size):
      
      factor = (size + 1) // 2
      if size % 2 == 1:
          center = factor - 1
      else:
          center = factor - 0.5
      og = np.ogrid[:size, :size]
      filter = (1 - abs(og[0] - center) / factor) * \
               (1 - abs(og[1] - center) / factor)
      return filter
docs: Make a 2D bilinear kernel suitable for upsampling