Rerunning the code on the CPU shouldn’t raise a CUDA error, if the GPU is not used at all.
I don’t know if you are using a Jupyter notebook or another REPL environment, but make sure to restart the environment once you ran into a CUDA assert as these errors might be sticky.