You could apply transform.Resize first with a manually sampled size in the range [256, 512] first and later transforms.CenterCrop.
Since you would sample the size in each iteration, I would suggest to use the functional API via torchvision.transforms.functional.resize(img, size, interpolation=2).



 amangasaryan:

However, it results in a different distribution of data then random rescaling of the whole image as suggested in the paper.


That makes sense, so you could follow the previous suggestion to manually reproduce the paper.