Torch multiprocessing Process and Queue

I’m tring to use multiprocessing.Process, I’m looking into torch.multiprocessing to use torch. But torch.multiprocessing.Queue and torch.multiprocessing.Process don’t seem to be compatible with each other.

So I tried several methods and found some combinations that are compatible with each other.

Is there any documentation on how to use it correctly for this part?

import torch.multiprocessing as ctx

queue = ctx.get_context("spawn").Queue()
pipe = ctx.Pipe()
process = ctx.Process(target = ...)
process.start()