for inputs, targets in data_loader:
targets = targets.type(torch.LongTensor) # casting to long
inputs, targets = inputs.to(device), targets.to(device)
loss = self.criterion(output, targets)
for epoch in range(num_epochs):
for (words, labels) in train_loader:
words = words.to(device)
labels = labels.type(torch.LongTensor) # <---- Here (casting)
labels = labels.to(device)