I’ve just read the project requirements, you probably use PyTorch version 0.3.1 as recommended? Then I think this answer 13 might be relevant.
Try to wrap your tensors data_1 and hidden_1 in torch.Variable() calls, maybe that will work.
PyTorch versions prior to 0.4.0 used Variable to indicate that a Tensor can be “backwarded” upon, whereas normal Tensors cannot.