Could you please provide a runnable script? I can’t really help debugging right now because your code doesn’t run due to some missing variables.
If it helps, it looks like an assert is being triggered in /home/nafizh/anaconda3/lib/python3.6/site-packages/torch/backends/cudnn/rnn.py line 171.