Solved by ptrblck in post #2 
              
              
                One possible approach would be to create two separate DataLoader and use their iterators directly via: 
dataset_head1 = TensorDataset(torch.randn(10, 1), torch.randn(10, 1))
dataset_head2 = TensorDataset(torch.randn(10, 1), torch.randn(10, 1))

for epoch in range(2):
    print('epoch ', epoch)
    #…