MCPcopy
hub / github.com/showlab/ShowUI / update

Method update

utils/utils.py:83–87  ·  view source on GitHub ↗
(self, val, n=1)

Source from the content-addressed store, hash-verified

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"

Callers 15

trainFunction · 0.95
mainFunction · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
__call__Method · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected