Warning: does not synchronize the deque!
(self)
| 65 | self.total += value * n |
| 66 | |
| 67 | def synchronize_between_processes(self): |
| 68 | """ |
| 69 | Warning: does not synchronize the deque! |
| 70 | """ |
| 71 | if not is_dist_avail_and_initialized(): |
| 72 | return |
| 73 | t = torch.tensor([self.count, self.total], |
| 74 | dtype=torch.float64, |
| 75 | device='cuda') |
| 76 | dist.barrier() |
| 77 | dist.all_reduce(t) |
| 78 | t = t.tolist() |
| 79 | self.count = int(t[0]) |
| 80 | self.total = t[1] |
| 81 | |
| 82 | @property |
| 83 | def median(self): |
nothing calls this directly
no test coverage detected