Converting External CUDA Streams to torch.cuda.Stream()

Hello. I have a question regarding PyTorch Stream.

If I create a CuPy stream, is it possible to convert it to a torch.cuda.Stream()?
I’m also interested in whether the same can be done for an RMM stream that I created. I’ve tried importing the RMM stream into PyTorch, but I haven’t been able to convert it into a torch.cuda.Stream().

RMM Stream: rmm/python/rmm/rmm/pylibrmm/stream.pyx at branch-25.04 · rapidsai/rmm · GitHub


I found this but still not matched: Is torch.cuda.Stream().cuda_stream equivalent to cudaStream_t