@ngimel, Thanks for your help. However, another problem encountered.
THCudaCheck FAIL file=/data/users/soumith/miniconda2/conda-bld/pytorch-0.1.9_1487343590888/work/torch/lib/THC/generated/../generic/THCTensorMathPointwise.cu line=246 error=8 : invalid device function
Traceback (most recent call last):
  File "main.py", line 157, in <module>
    train()
  File "main.py", line 131, in train
    output, hidden = model(data, hidden)
  File "/data/disk1/ckyn/ProgramFiles/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 202, in __call__
    result = self.forward(*input, **kwargs)
  File "/data/disk1/ckyn/workbench/learn/pytorch/examples/word_language_model/model.py", line 28, in forward
    output, hidden = self.rnn(emb, hidden)
  File "/data/disk1/ckyn/ProgramFiles/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 202, in __call__
    result = self.forward(*input, **kwargs)
ons/rnn.py", line 138, in forward
    nexth, output = func(input, hidden, weight)
  File "/data/disk1/ckyn/ProgramFiles/anaconda2/lib/python2.7/site-packages/torch/nn/_functions/rnn.py", line 67, in forward
    hy, output = inner(input, hidden[l], weight[l])
  File "/data/disk1/ckyn/ProgramFiles/anaconda2/lib/python2.7/site-packages/torch/nn/_functions/rnn.py", line 96, in forward
    hidden = inner(input[i], hidden, *weight)
  File "/data/disk1/ckyn/ProgramFiles/anaconda2/lib/python2.7/site-packages/torch/nn/_functions/rnn.py", line 22, in LSTMCell
    gates = F.linear(input, w_ih, b_ih) + F.linear(hx, w_hh, b_hh)
  File "/data/disk1/ckyn/ProgramFiles/anaconda2/lib/python2.7/site-packages/torch/autograd/variable.py", line 752, in __add__
    return self.add(other)
  File "/data/disk1/ckyn/ProgramFiles/anaconda2/lib/python2.7/site-packages/torch/autograd/variable.py", line 292, in add
    return self._add(other, False)
  File "/data/disk1/ckyn/ProgramFiles/anaconda2/lib/python2.7/site-packages/torch/autograd/variable.py", line 286, in _add
    return Add(inplace)(self, other)
  File "/data/disk1/ckyn/ProgramFiles/anaconda2/lib/python2.7/site-packages/torch/autograd/_functions/basic_ops.py", line 13, in forward
    return a.add(b)
RuntimeError: cuda runtime error (8) : invalid device function at /data/users/soumith/miniconda2/conda-bld/pytorch-0.1.9_1487343590888/work/torch/lib/THC/generated/../generic/THCTensorMathPointwise.cu:246

Is there any idea about this?