there is a bug:
def getitem(self, index):
x = self.data[index]
y = self.target[index]
data_dict={‘data’: x, ‘target’: y}
return data_dict
then all item in the batch will be the same as the first item, which is wrong.
I want to write this because sometime the data_dict is returned by a function, and it has so many keys.