(self, val, n=1)
| 81 | self.count = 0 |
| 82 | |
| 83 | def update(self, val, n=1): |
| 84 | self.val = val |
| 85 | self.sum += val * n |
| 86 | self.count += n |
| 87 | self.avg = self.sum / self.count |
| 88 | |
| 89 | def all_reduce(self): |
| 90 | device = "cuda" if torch.cuda.is_available() else "cpu" |
no outgoing calls
no test coverage detected