Note sure, can’t see anything wrong there. Have almost identical code here (https://github.com/rasbt/deep-learning-book/blob/master/code/model_zoo/pytorch_ipynb/logistic-regression.ipynb 3, at the bottom under High-level implementation using the nn.Module API) and here (https://github.com/rasbt/deep-learning-book/blob/master/code/model_zoo/pytorch_ipynb/softmax-regression.ipynb 1) and it works fine.
Probably not the root of the problem, but you can replace
x_data_train = Variable(torch.Tensor(X_train)).float()
y_data_train = Variable(torch.Tensor(y_train)).type(torch.LongTensor)

with
x_data_train = torch.tensor(X_train, dtype=torch.float32)
y_data_train = torch.tensor(y_train, dtype=torch.int32)