MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / __init__

Method __init__

SwissArmyTransformer/examples/yolos/util/misc.py:31–37  ·  view source on GitHub ↗
(self, window_size=20, fmt=None)

Source from the content-addressed store, hash-verified

29 """
30
31 def __init__(self, window_size=20, fmt=None):
32 if fmt is None:
33 fmt = "{median:.4f} ({global_avg:.4f})"
34 self.deque = deque(maxlen=window_size)
35 self.total = 0.0
36 self.count = 0
37 self.fmt = fmt
38
39 def update(self, value, n=1):
40 self.deque.append(value)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected