You wouldn’t really need to current transformation, as you are converting the input to a PIL.Image and then back to a tensor.
You could simply normalize the tensor via:
x = x / 255.

to get values in the range [0, 1].