reflects by border "1" and becomes "x'' = -0.5".
Note:
 This function is often used in conjunction with "affine_grid()"
 to build Spatial Transformer Networks .

Note:
 When using the CUDA backend, this operation may induce
 nondeterministic behaviour in its backward pass that is not
 easily switched off. Please see the notes on Reproducibility for
 background.

Note:
 NaN values in "grid" would be interpreted as "-1".

Parameters:
      * input (Tensor) -- input of shape (N, C, H_\text{in},
        W_\text{in}) (4-D case) or (N, C, D_\text{in}, H_\text{in},
        W_\text{in}) (5-D case)
  * **grid** (*Tensor*) -- flow-field of shape (N, H_\text{out},
    W_\text{out}, 2) (4-D case) or (N, D_\text{out}, H_\text{out},
    W_\text{out}, 3) (5-D case)

  * **mode** (*str*) -- interpolation mode to calculate output
    values "'bilinear'" | "'nearest'" | "'bicubic'". Default:
