LSTM_LN
LSTM_LN copied to clipboard
batch first mode causes some error
`if name == 'main':
model = LSTM(50, 100, 2,batch_first=True)
x = Variable(Tensor(32,50, 50))
h = model.init_hidden(32)
print(model(x, h))`
and it will return :
`Traceback (most recent call last):'
'File "lstm.py", line 379, in
' print(model(x, h))'
' File "Python\Python35\lib\site-packages\torch\nn\modules\module.py", line 489, in call'
' result = self.forward(*input, **kwargs)'
' File "lstm.py", line 92, in forward'
' f_x, f_h = self.layer_forward(l, x, h, image_emb)'
' File "lstm.py", line 72, in layer_forward'
' y, h = l(x, h, image_emb)'
' File "Python\Python35\lib\site-packages\torch\nn\modules\module.py", line 489, in call'
' result = self.forward(*input, **kwargs)'
' File "lstm.py", line 336, in forward'
' preact = i2h + h2h'
'RuntimeError: The size of tensor a (50) must match the size of tensor b (32) at non-singleton dimension 0`