newuser1:

I see a lot of places making it seem as if transform.Resize(299) and transform.Resize((299,299)) should give the same results, but that is not the case from my tests.


Yeah, the  StackOverflow explanation 2 is wrong. In general, it seems that there aren’t many places to get better PyTorch advice than on these forums here.



 newuser1:

Can someone clarify if this is expected behavior?


The TorchVision documentation 2 explains:

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)

The idea of the latter is to not ruin the aspect ratio of the image and follow by a cropping operation to the final size.
Best regards
Thomas