Not that it makes a difference, probably, but conceptually, you also have an extra step in normalize_transform compared to you other function. I.e., transforms.ToTensor() converts tensors to [0, 1] range. So, it’s basically first doing that conversion, and then in an additional operation, it is doing (x-0.5) * 2.
How exactly are you running the two function to compare them, in a Python for-loop?