You can do something similar to how the shape of embedded is changed to a 3D tensor so that it can be fed to the LSTM:



 may_Alaa:

embedded = self.embedding(input).view(1, 1, -1)


One solution is:
input_sequence = input_sequence.view(1, 1, -1)
Another approach is to convert it into a 3D tensor without pushing all the features into a single dimension:
input_seq = input_seq.view(1, num_of_frames, -1)
In this case output will not be squeeze-able to a scalar. So you will have to make some changes in the code structure to accommodate the attention mechanism.