Most image transformations can be done using PyTorch transforms. For your particular question, you can can use torchvision.transforms.Resize.
import torch
from torchvision import transforms

resize = transforms.Resize((256, 256)) # the output shape you want

# an example 3D tensor
t = torch.rand(143, 512, 512)

t_resized = resize(t) # you should get its shape as (143, 256, 256), preserving the channel dimension