Do you have a particular question regarding the linked documentation for RandomCrop?
What do you mean by different dimensions and what is not working?
Do you get any error message using this transformation?