How to unpack data_loader in small size

I have a PyTorch data_loader with three fields and iterates as follows:
for i, (input, target_class, name) in enumerate(data_loader):

But I want it to enumerate over ‘input’ and ‘target_class’. How can I unpack data_loader in two values given that it has originally three values? Please help. Thanks.

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.

Do you want something like this?

for i, (input, target, _) in enumerate(dataloader):

Or, you can change your Dataset to yield (_iter_) or return (_getitem_) only input and target without name.