device = "cuda" if torch.cuda.is_available() else "cpu"
class LSTM(nn.Module):
    def __init__(self, n_hidden = 128,):
        super(LSTM, self).__init__()
        self.n_hidden = n_hidden
        #self.linearIn = nn.Linear(6, 128)
        self.lstm1 = nn.LSTMCell(1, self.n_hidden,)
        self.lstm2 = nn.LSTMCell(self.n_hidden, self.n_hidden)
        self.linear = nn.Linear(self.n_hidden, 1)
    
    def forward(self, input, future=0):
        outputs = []
        h_t = torch.zeros(input.size(0), 128, dtype=torch.float32).to(device)
        c_t = torch.zeros(input.size(0), 128, dtype=torch.float32).to(device)
        h_t2 = torch.zeros(input.size(0), 128, dtype=torch.float32).to(device)
        c_t2 = torch.zeros(input.size(0), 128, dtype=torch.float32).to(device)
        
        for input_t in input.split(1, dim=1):
            h_t, c_t = self.lstm1(input_t, (h_t, c_t))
            h_t2, c_t2 = self.lstm2(h_t, (h_t2, c_t2))
            output = self.linear(h_t).to(device)
            outputs += [output]
        for i in range(future):# if we should predict the future
            h_t, c_t = self.lstm1(output, (h_t, c_t))
            h_t2, c_t2 = self.lstm2(h_t, (h_t2, c_t2))
            output = self.linear(h_t)
            outputs += [output]
        outputs = torch.cat(outputs, dim=1)
        return outputs

New code, I added it to the c_t as well