How to re-normalize an image tensor back to a given range?

Hi! I have images from a dataloader which is normalized by a specific setting of mean and std, for example:

transform = transforms.Compose([
            transforms.ToTensor(),
            transforms.Normalize(mean=(0.485, 0.456, 0.406),
                       std=(0.229, 0.224, 0.225))
            ])

Since the normalization is not as simple as taking values from 0 to 1 and normalizing to -1 and 1, I don’t know how I can re-nornalize the image to 0 and 1. Say I have a batch of data from this data loader, which is a batch_size3H*W tensor, how do I normalize this tensor so that each image are now in range (0,1)?

Thanks!

Just delete the normalization part and they will be in that range.