I could reproduce this issue on 1.0.0.dev20190207 and 1.1.0a0+7343e47, while 0.4.1 runs fast.
Also, I tried to run torch.utils.bottleneck, but apparently more than 24GB of memory was allocated and the process run OOM. Was this also the case for your runs?
Thanks for the script. I’ll try to debug it a bit further.