Hi Mostafa,
sorry for the late reply. I’ve seen the thread but have completely forgotten to answer. 
RandomCrop works on images and your current code should also work as you put all image transformations before ToTensor. So if no image transformations are given, your data will just be transformed to a tensor and normalized. Otherwise it will be cropped randomly etc. before the ToTensor transform.
Your code makes sense and I would like to stick to it.
Therefore we would need to create our own RandomCrop class.
We can derive from transforms.RandomCrop and just add the “counter” from my previous example so that the crop indices will be resampled in every second iteration:
class MyRandomCrop(transforms.RandomCrop):
    def __init__(self, size, padding=0, pad_if_needed=False):
        super(MyRandomCrop, self).__init__(size, padding, pad_if_needed)
        self.counter = 0
        self.crop_indices = []
        
    def __call__(self, img):
        if self.padding is not None:
            img = F.pad(img, self.padding, self.fill, self.padding_mode)

        # pad the width if needed
        if self.pad_if_needed and img.size[0] < self.size[1]:
            img = F.pad(img, (self.size[1] - img.size[0], 0), self.fill, self.padding_mode)
        # pad the height if needed
        if self.pad_if_needed and img.size[1] < self.size[0]:
            img = F.pad(img, (0, self.size[0] - img.size[1]), self.fill, self.padding_mode)
        
        resample = self.counter % 2 == 0
        self.counter += 1
        if resample:
            self.crop_indices = self.get_params(img, self.size)
        i, j, h, w = self.crop_indices

        return F.crop(img, i, j, h, w)


transform = transforms.Compose([
    MyRandomCrop((10, 10)),
    transforms.ToTensor()
])
        
class MyDataset(Dataset):
    def __init__(self, image_paths, transform):
        self.image_paths = image_paths
        self.transform = transform
    
    def __getitem__(self, index):
        image = Image.open(self.image_paths[index])
        x = self.transform(image)
        return x
    
    def __len__(self):
        return len(self.image_paths)

Depending on the torchvision version you are using you might need to adapt the arguments to RandomCrop.
Let me know, if that works for you!