Solved by braindotai in post #13 
              
              
                Here is the working solution- 
train_iterator = torch.utils.data.TensorDataset(x_train, y_train.reshape(-1).long())
train_data = torch.utils.data.DataLoader(train_iterator, batch_size = 64, shuffle = True)

for x, y in train_data:
    break
print(x.shape, y.shape) # will print (64, 1, 100), (64,)

c…