Thanks for your suggestion  Yeah I’ve tried that and it actually worked (on a simple test case). What I mainly wanted to know is if PyTorch guarantees that the CUDA context is not destroyed throughout the lifetime of the process. Without this guarantee, I think it’s better not to assume that the context is sharable.