How to reshape the different images to the same size?

I have got a data set of different shape (eg. torch.Size([3, 400, 650]) , torch.Size([3, 280, 482]) , torch.Size([3, 197, 626]) and so on.). How can I reshape these images to the same size (say toch.Size(3,250, 250)).

You can try to use [Resize] and transforms:-import torchvision.transforms as transforms.

Example : data = resize(data.reshape(32, 32, -1), (28, 28))