I think I found some inconsistency between documentation, behavior and error messages while using F.interpolate.
mode=linear documentation says that input should be a 3D tensor. That’s why we see expected error when passing the 4D tensor.
x = torch.rand(1,2,100,100) F.interpolate(x, size=(64,64), mode="linear")
NotImplementedError: Got 4D input, but linear mode needs 3D input
But at the same time when we pass 3D tensor to this very function error states that it’s 1D.
x = torch.rand(1,100,100) F.interpolate(x, size=(64,64), mode="linear")
ValueError: size shape must match input shape. Input is 1D, size is 2
Why is this way? What do I miss?