DataLoader is not working for labels

I think that the dataloader will fetch samples(which are tensors) in a batch and put them in a tensor with the first dimension being the batch size. If you want to get a list of lists then you probably need to make your own collate function.
If you don’t care about having a list of lists then you can put the labels in a tensor. For example, wrapping your list in a tensor will work so instead of this:

def __getitem__(self, index):
    return [1.0, 2.0, 3.0]

you can use this:

def __getitem__(self, index):
    return torch.FloatTensor([1.0, 2.0, 3.0])

If you want to see how to make your own collate function then look here: