The input is
a=torch.Tensor([[1,3],[2,4]])
a.unsqueeze_(0).unsqueeze_(0)
I try two methods:
F.upsample_bilinear(a, scale_factor=2)
to get
tensor([[[[1.0000, 1.6667, 2.3333, 3.0000],
[1.3333, 2.0000, 2.6667, 3.3333],
[1.6667, 2.3333, 3.0000, 3.6667],
[2.0000, 2.6667, 3.3333, 4.0000]]]])
The second one
F.interpolate(a, scale_factor=2, mode=‘bilinear’)
returns
tensor([[[[1.0000, 1.5000, 2.5000, 3.0000],
[1.2500, 1.7500, 2.7500, 3.2500],
[1.7500, 2.2500, 3.2500, 3.7500],
[2.0000, 2.5000, 3.5000, 4.0000]]]])
Why do they return two different outputs? Both do bilinear interpolation.