The ToTensor transformation will normalize the uint8 input image by dividing by 255 as seen here 45.
Based on your code, I guess that the Resize operation might lower the max. values of 255 to a smaller one (although I wouldn’t expect to see such a decrease). Could you try to use PIL.Image.NEAREST as the interpolation method and recheck the code?