Yeah I will try that
I just found that even I set CUDA_LAUNCH_BLOCKING=1, there is still an error when I try to print the tensor. I was running
CUDA_LAUNCH_BLOCKING=1
python train.py

is this the right way to set this environment variable?