Rsizing The Spatial Dimensions Of a 5D Tensor
For training a deep learning based model, I have an input tensor with the size of [batch_size=32, channels=3, Temporal=16, H=128, w=192] that includes frames of a video. I need to resize the spatial size of the tensor to (H=224, w=224). In other words, I need to have a tensor with the size of [batch_size=32, channels=3, Temporal=16, H=224, w=224]. How can I do that?

You can use torch.nn.functional.interpolate:
import torch.nn.functional as nnf

y = nnf.interpolate(x, size=(x.shape[2], 224, 224), mode='trilinear')

