No, there’s no temporal information in my data. It’s just sentences with a sentiment score. I processed/cleaned/tokenised the sentences and the sentiment score is also in integers so the features are just a list of numeric arrays, each array corresponding to a sentence and the labels is just a list of integers.
Edit: Just an update, I forgot that I did notice that the original author had reshaped the images tensor. However, I removed the reshape in my code. I have tried multiple ways of rewriting the code but it always comes back to needing a dimension of 3 when my input is 2. Even when I take the reshape part out completely, modify the forward pass, it still says requires 3. Here’s what I tried to do to modify the forward pass:
def forward(self, x):
        # Set initial states
        h0 = torch.zeros(self.num_layers*2, x.size(0), self.hidden_size).to(device) # 2 for bidirection 
        #c0 = torch.zeros(self.num_layers*2, x.size(0), self.hidden_size).to(device)        
        print('input size', x.size())
        # Forward propagate LSTM
        #x = x.view(-1, input_size)
        out, _ = self.lstm(x, h0)  # out: tensor of shape (batch_size, seq_length, hidden_size*2)        
        print('lstm size', out.size())
        
        # Decode the hidden state of the last time step
        out = self.fc(out)
        print('lstm size reshaped final',  out.size())
        logps = self.log_softmax(out)
        return logps

I guess what I am trying to figure out is where in the code does it first require the dimensions to be 3, so I can change that. Thanks!