Thanks for the update. I cannot reproduce the issue using the provided code:
class CustomDataset(Dataset):
    def __init__(self, samples, transform = None):
        self.transform = transform
        self.samples = samples

    def __getitem__(self, index):
        s1, s2, t = self.samples[index]

        if self.transform:
            s1 = self.transform(s1)
            s2 = self.transform(s2)

        return (s1, s2, t)

    def __len__(self):
        return len(self.samples)


samples = [[torch.randn(3, 400, 400), torch.randn(3, 400, 400), torch.randint(0, 10, (1,))]
           for _ in range(1000)]

transform = transforms.Compose([
        transforms.ToPILImage(),
        transforms.RandomHorizontalFlip(),
        transforms.RandomVerticalFlip(),
        transforms.CenterCrop(800),
        transforms.RandomResizedCrop(400),
        transforms.ToTensor(),
        transforms.Normalize(mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5))
    ])

train_dataset = CustomDataset(samples, transform=transform)
train_dataloader = DataLoader(train_dataset, batch_size=100, shuffle=True, num_workers=4, drop_last=False)

for x1, x2, t in train_dataloader:
    print(x1.shape, x2.shape, t.shape)