You could apply the torchvision.transforms.functional.resize method multiple times on the image and return the samples e.g. as a list. Since each sample would have a different size, you would need to write a custom collate_fn, as the default one won’t be able to stack the tensors in the batch dimension.