List type has no attribute 'to'

List type has no attribute ‘to’

print(type(label)) >>> class ‘list’

for data, label in train loader:
data=data.to(device)
>>label=label.to(device)

AttributeError: ‘tuple’ object has no attribute ‘to’

I also tried previous solutions but no success please help

problem solved, because im using windows so label split should use double \ instead of /.