Which index the dataloader is chosing

I am using torch.utils.data.DataLoader. like train_features, train_labels = next(iter(train_dataloader))
I want to determine which index the trainer is chosen?
for batch_idx, data in enumerate(trainloader, 0): can index from 0, but if we shuffle, can we know the indices for this batch?

You could return the passed index from the Dataset.__getitem__ method and use it in your DataLoader loop.