Is there any method to read 4 channel transperant image in PyTorch?

I am working on an image-to-image translation GANs. I have a transparent 4 channel image. But I am getting on 3 channels with PIL and the transparent part is getting blacked out. How I can read the image in PyTorch. Is there any method available?

I think you should convert the image to the right format using PIL could be the solution:

from PIL import Image

img =

# converts to 4 channels, where A represents the alpha/transparent channel