MCPcopy
hub / github.com/whai362/PVT / synchronize_between_processes

Method synchronize_between_processes

classification/utils.py:36–47  ·  view source on GitHub ↗

Warning: does not synchronize the deque!

(self)

Source from the content-addressed store, hash-verified

34 self.total += value * n
35
36 def synchronize_between_processes(self):
37 """
38 Warning: does not synchronize the deque!
39 """
40 if not is_dist_avail_and_initialized():
41 return
42 t = torch.tensor([self.count, self.total], dtype=torch.float64, device='cuda')
43 dist.barrier()
44 dist.all_reduce(t)
45 t = t.tolist()
46 self.count = int(t[0])
47 self.total = t[1]
48
49 @property
50 def median(self):

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected