this was a bug, i think it’s fixed on master via https://github.com/pytorch/pytorch/pull/2179 19
It will be part of the next release, or you can install master version from source (instructions here: https://github.com/pytorch/pytorch#from-source 7 )