MCPcopy Index your code
hub / github.com/pytorch/pytorch / update

Method update

torch/testing/_internal/common_quantization.py:147–151  ·  view source on GitHub ↗
(self, val, n=1)

Source from the content-addressed store, hash-verified

145 self.count = 0
146
147 def update(self, val, n=1):
148 self.val = val
149 self.sum += val * n
150 self.count += n
151 self.avg = self.sum / self.count
152
153 def __str__(self):
154 fmtstr = '{name} {val' + self.fmt + '} ({avg' + self.fmt + '})'

Callers 15

_comparison.pyFile · 0.45
common_nn.pyFile · 0.45
get_frame_varsMethod · 0.45
checkScriptMethod · 0.45
__call__Method · 0.45
common_utils.pyFile · 0.45
_test_fsdp_parityMethod · 0.45

Calls

no outgoing calls

Tested by 2

test_debug_infoMethod · 0.36