I think either you can create a DataSet that only returns the input and target_class, or you could do something like this:
for i, element in enumerate(data_loader):
    input, target_class, _ = element

Here you are indeed iterating over the three fields but are not using the name field.