'How to get the indices of the original data after the data is splitted using torch.utils.data.random_split?

I have a dataset which I wish to split using torch.utils.data.random_split(), but I want to know the indices which are used from the original data used to create the new data.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source