“you cannot delete the CUDA context while the PyTorch process is still running”

  
    
    
    Clearing the GPU is a headache vision
  
  
    No, you cannot delete the CUDA context while the PyTorch process is still running and would have to shutdown the current process and use a new one for the downstream application.