Yes, both can work. As for torchvision, it would be better to produce a 3D tensor from 2D using unsqueeze before calling transforms.Resize((new_h, new_w)). For example,
image_slice_2d = torch.rand(32, 32)
# shape is (32, 32), dtype = float32
image_slice_3d = image_slice_2d.unsqueeze(dim=0)
# shape is (1, 32, 32), dtype = float32

t = transforms.Resize((20, 20), interpolation=2)  # interpolation is bilinear here
res = t(image_slice_3d)
# res.shape = (1, 20, 20) and dtype = float32
res.shape, res.dtype