Oh, I think I get it. I should use padding_mode="border" in F.grid_sample() to be consistent with F.interpolate. Then, what are the cases making interpolate() and grid_sample()  different, as noted in this issue 1?