Hi,
I just wrote a simple demo code to reproduce the error. The code is here:

  
      
      GitHub
  
  
    

xiayandi/Pytorch_text_classification 152

A simple implementation of CNN based text classification in Pytorch - xiayandi/Pytorch_text_classification


  
  
    
    
  
  


The data is randomly generated, but everything is the same as mine except the actual values.
You could run main.py to reproduce the error.
I don’t know if this will be useful, my system is:
Ubuntu 16.04, TitanX, cuda 8.0, pip installed pytorch
Thanks!