Error in running Char RNN tutorial

I opened an issue here , but I havn’t recieved reply.
I encountered an error while running the Char RNN tutorial from the official PyTorch docs(here).

I got this error:

Traceback (most recent call last):
  File "", line 86, in <module>
    rnn = RNN(n_letters, n_hidden, n_categories)
  File "", line 72, in __init__
    self.i2o = nn.Linear(input_size + hidden_size, output_size)
  File "/home/ayush99/anaconda3/lib/python3.6/site-packages/torch/nn/modules/", line 46, in __init__
  File "/home/ayush99/anaconda3/lib/python3.6/site-packages/torch/nn/modules/", line 49, in reset_parameters
    stdv = 1. / math.sqrt(self.weight.size(1))
RuntimeError: invalid argument 2: dimension 1 out of range of 0D tensor at /opt/conda/conda-bld/pytorch-cpu_1518282373170/work/torch/lib/TH/generic/THTensor.c:24

System specs: I was running this on the CPU.
Why is this happening? The examples from the docs should work just fine.