Labels follow the same but
list_of_labels = [0, 1, 2, 0, 1, 3, ..., 4]
torch_labels = torch.LongTensor(list_of_labels) # for classifier
torch_labels = torch.FloatTensor(list_of_labels) # for regression

Wish my comment will help but the question is too broad.
The keypoint is converting a list into tensor.