there might be some bugs in previous versions of pytorch, can you try pytorch master to see if the error is fixed?