How to resize and pad in a torchvision.transforms.Compose()?

The above code snippet will pad to the maximum of width or height value of the image.
e.g.
input image - 180x240
resulting image will be - padded 240x240

Original image:cat

Padded image:padcat