def METHOD_NAME(im, size=7):
  pad_size = size // 2
  def conv(im):
    # This function does not seem to work with only two dimensions.
    padded_im = pad_fn(im.unsqueeze(0), pad_size, padding_mode='symmetric')
    # Remove the first dim and the padding from the second dim.
    padded_im = padded_im[0, pad_size:-pad_size]
    filters = torch.ones(1, 1, size, dtype=padded_im.dtype, device=DEVICE)
    # Add additional dimension for the number of channels.
    return F.conv1d(padded_im.unsqueeze(1), filters).squeeze(1) / size
  im = conv(im)
  im = conv(im.T)
  return im.T