MCPcopy Create free account
hub / github.com/alinlab/SelfPatch / __init__

Method __init__

utils.py:209–215  ·  view source on GitHub ↗
(self, window_size=20, fmt=None)

Source from the content-addressed store, hash-verified

207 """
208
209 def __init__(self, window_size=20, fmt=None):
210 if fmt is None:
211 fmt = "{median:.6f} ({global_avg:.6f})"
212 self.deque = deque(maxlen=window_size)
213 self.total = 0.0
214 self.count = 0
215 self.fmt = fmt
216
217 def update(self, value, n=1):
218 self.deque.append(value)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected