all_lists = [list0, list1, list2, list3, list4, list5, list6, list7, list8, list9]

preds = classifier(xs)
_, predicted = torch.max(preds.data, 1)

index1 = predicted.item()
if predicted == ys:
    all_lists[index1].append((xs,ben))

but it only works for a batch_size=1 how can I do this for batch_size>1, so that the data is appended into its corresponding list?