Combine multiple Variables to one
x is a Variable which has 3 dims. <SCODE>x.size()[0] is sequence length
x.size()[1] is batch size.
<ECODE> I did something below(for LSTM’s input): <SCODE>temp = []
for i in xrange(len(x)):
    temp.append(nn.Linear(512, 256)(x[i]))
<ECODE> As you can see here, I got many Variables stored in temp. But I what I want is to combine these new Variables into one Variable. How can I do it? Many thanks.
melody-rain
Lyken17
cat’s input should be tensors, but temp’s elements are Variables.
melody-rain
torch.cat also works with Variables.
jekbradbury