Warning: does not synchronize the deque!
(self)
| 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): |
nothing calls this directly
no test coverage detected