Below are some information that are related to the image. I am not sure if there is a handy function that returns the shape of the resulting tensor.
print (img.info) #various information about the image.
print(img.size) #size of the image
print(img.getbands()) #different channel present in the data
print(len(img.split())) # num_channel


Output:
{'gamma': 0.45455, 'chromaticity': (0.3127, 0.329, 0.64, 0.33, 0.3, 0.6, 0.15, 0.06)}
(1196, 700)
('P',)
1