Why is nn.GRU designed to only accept inputs of shape (1, x, input_size)? What does the second dimension mean?
If an input variable of dimension (1, input_size) together with a hidden state of dimension (1, hidden_size) are fed into nn.GRU, the following error will occur:

RuntimeError: matrices expected, got 1D, 2D tensors at /py/conda-bld/pytorch_1493680494901/work/torch/lib/TH/generic/THTensorMath.c:1232

Only after adding another dimension in the middle will the code runs.