I suppose you want to shuffle your input data. But you should not do that in the __getitem__. There are two wats to do that:

Shuffle self.data_list in the __init__ funciton
Use the DataLoader and set parameter shuffle=True; That will take care of the shuffling part.

from torch.utils.data import DataLoader
dataset = MyDataset(...)

data_loader = DataLoader(dataset,
                         batch_size=32,
                         shuffle=True,
                         num_workers=1)