John_J_Watson:

find this really bizarre, since, after PadSquare, when I resize using a single int, it should give me a square image back - but it seems like it does not… why is this? is this a bug?


No, it’s not a bug and is expected behavior for non-square input images.
From the docs:

size (sequence or int) –
Desired output size. If size is a sequence like (h, w), output size will be matched to this. If size is an int, smaller edge of the image will be matched to this number. i.e, if height > width, then image will be rescaled to (size * height / width, size).

Using the tuple is thus the right approach for non-square inputs.