Hello,
I believe RandomCrop 171 is the transformation you are looking for (part of torchvision). If you are not familiar with torchvisions’s transforms, I suggest that you look at the following tutorial 114.