Hi, I am trying to implement a seq2seq model for machine translation. I successfully encoded a batch of input sequences to their respective fixed vector representations. Then i fed the hidden representation and an input token to a decoder network. The output of decoder network is then fed to a linear layer and then finally to a softmax layer.
for i, input_t in enumerate(embedded.chunk(embedded.size(1), dim=1)):
    h_t, c_t = self.lstm(torch.squeeze(input_t), (h_t, c_t))
    output.append(F.softmax(self.linear(h_t)))

However when I try to compute the loss
loss = criterion(decoder_outputs, batch_target_sequences)

it gives the following error
expected a Variable argument, but got list

I also tried to convert it to a variable but got the following error
 Variable data has to be a tensor, but got list

Can anybody please suggest a way to convert a list of tensors to tensor so that Variable argumnet can accept it?
Thanks