Based on your code snippet you are storing the input data as LongTensors in:
self.x_train=torch.tensor(x,dtype=torch.int64)

while the nn.GRU layer has floating point parameters and also expects floating point inputs.
Use dtype=torch.float32 while creating the tensor and it should work.