What kind of resize do you want to do? Do you want to actually rescale the images (downsampling), or do you want to select the center 28x28 pixels, dis arding the rest (cropping)?
Is this a preprocessing operation (before the data goes into your model), or do you want to do this as part of your model?
Also, are you using a dataloader to read the images, or are you getting the data array from somewhere else?