title: pytorch's grid_sample return an incorrect value
body: <p>I have a 3D matrix: <code>img[i, j, k] = i+j+k</code>.</p>
  <p>In my opinion, if I want the value of (<code>1</code>, <code>2</code>, <code>3</code>), the <code>grid_sample</code> should return <code>6</code>. But it not.</p>
  <p>The code is:</p>
  <pre><code>import torch
  from torch.nn import functional as F
  import numpy as np
  X, Y, Z = 10, 20, 30
  img = np.zeros(shape=[X, Y, Z], dtype=np.float32)
  for i in range(X):
      for j in range(Y):
          for k in range(Z):
              img[i,j,k] = i+j+k
  inp = torch.from_numpy(img).unsqueeze(0).unsqueeze(0)
  grid = torch.from_numpy(np.array([[1, 2, 3]], dtype=np.float32)).unsqueeze(1).unsqueeze(1).unsqueeze(1)
  grid[..., 0] /= (X-1)
  grid[..., 1] /= (Y-1)
  grid[..., 2] /= (Z-1)
  grid = 2*grid - 1
  outp = F.grid_sample(inp, grid=grid, mode='bilinear', align_corners=True)
  print(outp)
  </code></pre>
  <p>The <code>grid_sample</code> return <code>6.15</code>. Is there anything wrong with my code?</p>