Why data.random_split produce different distribution of dataset

I am currently working with pytorch 0.4.1
In my dataset, there are 10,736 instances that have 9 different classes.
I tried to train my models with same training set and testset in the dataset.
After applying torch.manual_seed(), I splited train and test dataset with data.random_split function. each size is 0.8 and 0.2
The code is here
1st.

torch.manual_seed(10)
train_dataset, test_dataset_1gram = data.random_split(full_dataset_1gram, [train_size, test_size])
train_loader = data.DataLoader(train_dataset, batch_size=BATCH_SIZE, shuffle = False)
test_loader_1gram = data.DataLoader(test_dataset_1gram, batch_size=BATCH_SIZE, shuffle=False)

2nd.

# spliting
torch.manual_seed(10)
train_dataset, test_dataset_2gram = data.random_split(full_dataset_2gram, [train_size, test_size])
train_loader = data.DataLoader(train_dataset, batch_size=BATCH_SIZE, shuffle = False)
test_loader_2gram = data.DataLoader(test_dataset_2gram, batch_size=BATCH_SIZE, shuffle=False)

… last

# spliting
torch.manual_seed(10)
train_dataset, test_dataset_addition = data.random_split(full_dataset_addition, [train_size, test_size])
train_loader = data.DataLoader(train_dataset, batch_size=BATCH_SIZE, shuffle = False)
test_loader_addition = data.DataLoader(test_dataset_addition, batch_size=BATCH_SIZE, shuffle=False)

the distribution of test datasets is here
1st
[(0, 302),
(1, 467),
(2, 595),
(3, 101),
(4, 6),
(5, 160),
(6, 72),
(7, 244),
(8, 201)]

2nd
[(0, 302),
(1, 467),
(2, 595),
(3, 101),
(4, 6),
(5, 160),
(6, 72),
(7, 244),
(8, 201)]

3rd
[(0, 302),
(1, 467),
(2, 595),
(3, 101),
(4, 6),
(5, 160),
(6, 72),
(7, 244),
(8, 201)]

4th
[(0, 306),
(1, 466),
(2, 596),
(3, 99),
(4, 5),
(5, 157),
(6, 75),
(7, 242),
(8, 202)]

BOOM? why the distribution suddenely different?
the overall dataset would be this
[(0, 1532),
(1, 2470),
(2, 2937),
(3, 447),
(4, 39),
(5, 732),
(6, 387),
(7, 1179),
(8, 1013)]
and I checked all of datasets I have same distribution.

what is the problem?

If you are working with seeds to get the exact same results, you would have to make sure no additional calls to the random number generator are called before the actual split call.

I would recommend to create the split indices once, store them, and reuse for each dataset (e.g. as a Subset), which would make it easier.

On the other hand, if you want to use the seeding approach, you would have to debug your code and make sure that no other calls were made while creating your 4th dataset, which might be cumbersome.