How can I normalize a batch of image

For some reason, I normalized the image in Dataset by transform.normalize([0.5,0.5,0.5],[0.5,0.5,0.5]),which is a tensor with batch dim.
after that , I need the tensor flow in a pretrain Alexnet model, so I have to renormalize it by using means[0.485, 0.456, 0.406], and std[0.229, 0.224, 0.225], and I need the gradient so I can not convert it to PIL image, how can I do that?

Can you get the data from the Tensor by calling its .data attribute ?