I understand that we need to set RNN in training mode to optimize the weights of the neural network. However, in my case, I was trying to use
torch.autograd.grad to compute the gradient w.r.t. the inputs. It still returned the same error.
embedded_grad = torch.autograd.grad(loss, embedding_temp)
Is this normal or I have a bug in my code?