Issue trying to index pandas dataframe via tensor scalar

That code works for me as well. I believe it had something to do with the WeightedRandomSampler from my previous post DataLoader - using SubsetRandomSampler and WeightedRandomSampler at the same time. The variable index of the __getitem__ method is a tensor for the code when I make use of the WeightedRandomSampler. Thank you.

1 Like