Warning: does not synchronize the deque!
(self)
| 27 | self.total += value * n |
| 28 | |
| 29 | def synchronize_between_processes(self): |
| 30 | """ |
| 31 | Warning: does not synchronize the deque! |
| 32 | """ |
| 33 | if not is_dist_avail_and_initialized(): |
| 34 | return |
| 35 | t = torch.tensor([self.count, self.total], dtype=torch.float64, device='cuda') |
| 36 | dist.barrier() |
| 37 | dist.all_reduce(t) |
| 38 | t = t.tolist() |
| 39 | self.count = int(t[0]) |
| 40 | self.total = t[1] |
| 41 | |
| 42 | @property |
| 43 | def median(self): |
nothing calls this directly
no test coverage detected