I’m afraid this is not possible to do as setting the cuda type causes cuda to be initialized and the limitation with fork and cuda is due to the cuda driver itself, not pytorch. So there is little we can do.
Note that in general, I would advise against setting the default type on cuda as it might make simple ops slower than they should (in particular when default Tensors are created).