Interestingly, the RandomCrop Transform is supposed to work on PIL images and Tensors according to this 2.
But it is only working in PIL images, at least in my torch==1.6.0 and torchvision==0.7.0 environment.
Same for transforms.functional.crop
Update:
Apparently, the feature got introduces just a couple of weeks ago (https://github.com/pytorch/vision/pull/2342 4)
and is not yet on anaconda