Was the code working before, i.e. did you change anything in the code or your setup (CUDA, cudnn version)?
Could you rerun the code with CUDA_LAUNCH_BLOCKING=1 python script.py args and post the stack trace here again, please?
Also, which PyTorch, CUDA, cudnn versions are you using and how did you install these?