Would that not be: img -= img.min() instead of +?
If I try that I start off with an image:

and then get the following image after the transform:

strangely with a mean of nan:
tensor[0,:,:].mean()

Out: nan

which is odd as I use tensor[tensor != tensor] = 0 to remove all nan values upon loading the file.