input_tensor = torch.tensor(two_line_seq, dtype = torch.float, requires_grad=True)

?.backward(torch.tensor([1.]))
input_tensor += input_tensor.grad

But from which tensor I must make backpropagation?
Suppose I have to do it with last output of the net then we have

input_tensor = torch.tensor(two_line_seq, dtype = torch.float, requires_grad=True)
pred = rnn(input_tensor)
single_loss = loss(pred, label)
single_loss.backward(torch.tensor([1.]))
input_tensor += input_tensor.grad

but torch.tensor([1.]) is the default argument for backward so I’m confused…