Hi,
My goal is to use an LSTM in a dataloader. I am filling up a volume in the dataloader with LSTM states. At some iteration, I take a feature vector and assign it to a position in this space. Then I use the h_n and c_n I have assigned to this space (from a previous iteration) as an input to my LSTM in addition to the feature vector. The output I save in the volume as well, and additionally I save the new h_n and c_n in the volume. Then, after this process is complete, I return the final outputs of the lstm.
After loading from the dataloader, I use these outputs as inputs to another NN to make a prediction, and finally, want to backpropogate to update both the prediction NN and the LSTM parameters.
So of course when I am saving the LSTM outputs in a volume, I need to keep its grad_fn, however, must I also save the grad_fn info of h_n and c_n when saving it in my volume and using it as inputs to the LSTM in the upcoming iteration?