Could you rerun the script with CUDA_LAUNCH_BLOCKING=1 python script.py args?
It seems that a CUDA error was raised before the line of code in question.
Also, could you update to PyTorch 1.5.1, if you are using an older version (or the nightly binaries)?