Could you update PyTorch to the latest stable release and rerun the code, please?
In case you are still hitting the issue, could you then post a minimal, executable code snippet so that we could try to reproduce it?