If you got an Image of size 128x128. To resize it to 224x224. Import Image and ImageOps from PIL

img = Image.open(path).convert(“RGB”)
img = ImageOps.fit(img, (224,224), Image.ANTIALIAS)

Assuming you had done all this and finally got tensor to 3x224x224 before loading as batches you could possibly do -

((Tensor*2.)+2.)/2.

This should get the tensor in [0,1] range.