dmlc--dgl
74c9d27d16
* [Misc] Auto-format tests. * more --------- Co-authored-by: Ubuntu <ubuntu@ip-172-31-28-63.ap-northeast-1.compute.internal>
27 行
433 B
Python
27 行
433 B
Python
import os
|
|
import unittest
|
|
|
|
import dgl
|
|
|
|
import torch as th
|
|
import torch.multiprocessing as mp
|
|
|
|
|
|
def sub_ipc(g):
|
|
print(g)
|
|
return g
|
|
|
|
|
|
@unittest.skipIf(os.name == "nt", reason="Do not support windows yet")
|
|
def test_torch_ipc():
|
|
g = dgl.graph(([0, 1, 2], [1, 2, 3]))
|
|
ctx = mp.get_context("spawn")
|
|
p = ctx.Process(target=sub_ipc, args=(g,))
|
|
|
|
p.start()
|
|
p.join()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
test_torch_ipc()
|