kevinyang:

This is on PyTorch 1.5.1, and I do not encounter the issue on 1.4.0.


This sounds like a regression. And I confirm I can reproduce the reported behavior.
Could you please submit an issue to https://github.com/pytorch/pytorch/issues 4 to report this bug?