If you pass a single value, only the smaller size will be matched to this value and the other one will be resized accordingly to keep the ratio as equal as possible.
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)