Solved by ptrblck in post #2 
              
              
                This issue is created by the wrong usage of i inside the lambda definition, you would need to bind i for each created function. 
This should solve the issue: 
train_loader = np.empty((2), dtype=np.object)
for i in range(2):
    train_loader[i] = torch.utils.data.DataLoader(
      torchvision.dataset…