ProGamerGov:

Edit, I forgot to take the tensor out of it’s Variable:


That function seems to only work on PIL images for Dataloader class when importing torchvision data. It doesn’t work on Tensors as far as I tried at this moment.
It might be faster to write your own normalize function.