You should change __getindex__ to __getitem__.
Also, the usual approach is to iterate your DataLoader, not the Dataset.
Try:
for batch_idx, (x, y) in enumerate(loader):
    #do stuff

Is there a reason you are re-initializing the Dataset and DataLoader in the for-loop?