Try something like this:
torch.utils.data.DataLoader(
     dataset, batch_size=8, shuffle=True, num_workers=1,
     collate_fn=collate_fn
)

where collate_fn is:
def collate_fn(batch):
    return list(zip(*batch))