Unfortunately, you can’t right now. And I don’t think it is a good idea since it will make PyTorch clumsy. A popular workaround could convert it into numeric types using sklearn.
Here is a short example:
from sklearn import preprocessing
import torch
labels = ['cat', 'dog', 'mouse', 'elephant', 'pandas']
le = preprocessing.LabelEncoder()
targets = le.fit_transform(labels)
# targets: array([0, 1, 2, 3, 4])
targets = torch.as_tensor(targets)
# targets: tensor([0, 1, 2, 3, 4])
Since you may need the conversion between true labels and transformed labels, it is good to store the variable le.