If you are working interactively in your notebook, all objects including tensors will be stored.
Even if you delete all tensors and clear the cache (usually not necessary), the CUDA context will still be initialized and will take some memory.
I guess the error is killing the kernel and thus the memory is completely released.