Hi,
Try the following code snippet.
import torch.nn as nn
import torch

x = torch.randn((128, 2, 2))
x = x.unsqueeze(dim=0)
ups = nn.Upsample(size=[5, 5])
out = ups(x).squeeze(0)
print(out.shape)

There are various modes of upsampling. Please check the doc here - https://pytorch.org/docs/master/generated/torch.nn.Upsample.html 3
Thanks
Regards
Pranavan