You could try to use PIL.Image.blend to blend the heatmap with your image.
Here is a small dummy example:
# Create heatmap image in red channel
heatmap = torch.empty(1, 252, 271).uniform_(0, 1)
heatmap = torch.cat((heatmap, torch.zeros(2, 252, 271)))

import torchvision.transforms.functional as TF
img = TF.to_pil_image(x)  # assuming your image in x
h_img = TF.to_pil_image(heatmap)

res = Image.blend(img, h_img, 0.5)