Resize image contained in pytorch Tensor

Is there a function that takes a pytorch Tensor that contains an image an resizes it? (e.g with bilinear interpolation) The functions in torchvision only accept PIL images.

From the post: How to simpler downsample an image tensor with bicubic?

LRTrans = transforms.Compose([
transforms.Scale(opt.imageSize // 4, Image.BICUBIC),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),
real_cpu.mul(0.5).add(0.5).mul(255).byte()[i].transpose(0, 2).transpose(0, 1).numpy())).numpy())```
1 Like