I am trying to use the torch.nn.interpolate to perform resizing of RGB image on the GPU. So, I allocate a RGB/BGR input as follows:
import torch
x = torch.rand(10, 10, 3).cuda()

So, now I want to resize the image to downsample it by a factor of 2 but only in the spatial dimensions. So the final size of the image should be (5, 5, 3). So, I am trying something like:
a = torch.nn.functional.interpolate(x, (5, 5, 3), mode='linear')
However, this fails as it expects the size parameter to be a single element. I tried a few other things but not sure how I can set it up so that the interpolation happens in the non-channel input dimensions.