MCPcopy Create free account
hub / github.com/pytorch/pytorch / test_allcompare

Method test_allcompare

caffe2/python/allcompare_test.py:64–82  ·  view source on GitHub ↗
(self, d, n, num_procs)

Source from the content-addressed store, hash-verified

62 )
63 @settings(deadline=10000)
64 def test_allcompare(self, d, n, num_procs):
65 dims = []
66 for _ in range(d):
67 dims.append(np.random.randint(1, high=n))
68 test_data = np.random.ranf(size=tuple(dims)).astype(np.float32)
69
70 with TemporaryDirectory() as tempdir:
71 processes = []
72 for idx in range(num_procs):
73 process = Process(
74 target=allcompare_process,
75 args=(tempdir, idx, test_data, num_procs)
76 )
77 processes.append(process)
78 process.start()
79
80 while len(processes) > 0:
81 process = processes.pop()
82 process.join()
83
84
85if __name__ == "__main__":

Callers

nothing calls this directly

Calls 8

randintMethod · 0.80
astypeMethod · 0.80
TemporaryDirectoryClass · 0.70
rangeFunction · 0.50
appendMethod · 0.45
startMethod · 0.45
popMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected