state is a torch.LongTensor, since you created it using integer values.
You could transform it to a FloatTensor, if you

pass float values (torch.tensor([1., 4., 3., 6., 0.])),
define a dtype, state = torch.tensor([1, 4, 3, 6, 0], dtype=torch.float32)

transform the tensor, state = torch.tensor([1, 4, 3, 6, 0]).float()