I run RNN sucessfully with the code.
rnn = nn.RNN(features, hidden_size, num_layers)
o, hidden = rnn(x, hidden)
and I run embedding example. Then, got RuntimeError.
RuntimeError: inconsistent tensor size, expected r_ [5 x 25], t [5 x 25] and src [2 x 25] to
have thesame number of elements, but got 125, 125 and 50 elements respectively at
/opt/conda/conda-bld/pytorch_1503970438496/work/torch/lib/TH/generic/THTensorMath.c:887
I set batch_first=True to use Embedding
x.size is [5, 8, 15]
hidden_size is [5, 2, 25]
nothing seems wrong.
And the error info seems not the dim problem?
The error is so strange.