In that case, the standard approach is to transform the images during data loading. Note the transforms variable in this example 837: you can add a Resize 1.0k operation to that pipeline (before the ToTensor) to scale the images.
If you’re not using a dataloader, it’s a bit trickier. I think the best option is to transform your data to numpy, use scikit-image to resize the images 367 and then transform it back to pytorch.
Cropping would actually be easier. For that you could just do:
data = data[:, :, 2:31, 2:31]
Note that pytorch image arrays are dimensioned as (batch, channels, height, width).