What is the correct input to LSTM?
I have tensors of varying length . These tensors are data for different time period. My aim is to get final output of the lstm.
torch.randn(4)-Time1
torch.randn(3,4)-Time2
torch.randn(4,4)-Time3

These are my  data, what is the input to LSTM from here?  , my aim is to get the final output from the lstm
For example, this is what I did
out_position = self.linear_out_position(features)
    _, (hn, _) = self.lstm(out_position)
        output = self.ffn(hn)

however i am getting result for each tensor, how can i only get the final result? Please I need your help

You can access the last hidden layer as hn[-1]
output = self.ffn(hn[-1])
