dgl.multiprocessing.pytorch.call_once_and_share๏ƒ

dgl.multiprocessing.pytorch.call_once_and_share(func, shape, dtype, rank=0)[source]๏ƒ

Invoke the function in a single process of the PyTorch distributed process group, and share the result with other processes.

Parameters:
  • func (callable) โ€“ Any callable that accepts no arguments and returns an arbitrary object.

  • shape (tuple[int]) โ€“ The shape of the shared tensor. Must match the output of func.

  • dtype (torch.dtype) โ€“ The data type of the shared tensor. Must match the output of func.

  • rank (int, optional) โ€“ The process ID to actually execute the function.