Does it work if you try to save an image in tensor format (e.g., channels first, in range (0, 1.0), dtype float)?
You can call the to tensor transformation to do this if you do not have it readily available in that format:
https://pytorch.org/vision/stable/_modules/torchvision/transforms/functional.html#to_tensor 77
Alternatively, you might be able to use a PIL image saving utility as well if you already have a PIL image on-hand:
https://pillow.readthedocs.io/en/stable/_modules/PIL/Image.html#Image.save 42