(self, val, weight)
| 40 | self.count = None |
| 41 | |
| 42 | def initialize(self, val, weight): |
| 43 | self.val = val |
| 44 | self.avg = val |
| 45 | self.sum = val * weight |
| 46 | self.count = weight |
| 47 | self.initialized = True |
| 48 | |
| 49 | def update(self, val, weight=1): |
| 50 | if not self.initialized: |