Dear concern, I would like to increase the number of data by torchvision.transform.compose but instead of increasing the number of epochs I would like to go for the second option proposed by @ptrblck in the latest reply.
I have changed the length of my data in __len__  by multiplying by 5 (now I have 5 times larger number of training data) but I do not see how to change the index  in its  __getitem__.
I am not sure to modify this part of the index. An example of this modification would be highly appreciated.
class PatientDataset(Dataset):
    def __init__(self, file_names, to_augment=False, transform=None, mode='train', problem_type=None):
        self.file_names = file_names
        self.to_augment = to_augment
        self.transform = transform
        self.mode = mode
        self.problem_type = problem_type

    def __len__(self):
        return 5*len(self.file_names)

    def __getitem__(self, idx):
        img_file_name = self.file_names[idx]
        image = load_image(img_file_name)
        mask = load_mask(img_file_name, self.problem_type)

        data = {"image": image, "mask": mask}
        
        augmented = self.transform(**data)
        image, mask = augmented["image"], augmented["mask"]

        if self.mode == 'train':
            if self.problem_type == 'binary':
                return img_to_tensor(image), torch.from_numpy(np.expand_dims(mask, 0)).float()
            else:
                return img_to_tensor(image), torch.from_numpy(mask).long()
        else:
            return img_to_tensor(image), str(img_file_name)