MCPcopy Create free account
hub / github.com/microsoft/BitNet / end_phase

Method end_phase

gpu/stats.py:36–48  ·  view source on GitHub ↗

Terminate the current phase.

(self, tokens: int, now: Optional[float] = None)

Source from the content-addressed store, hash-verified

34 self.current = None
35
36 def end_phase(self, tokens: int, now: Optional[float] = None):
37 """Terminate the current phase."""
38 if self.current is None:
39 return
40 if now is None:
41 now = time.time()
42 cname, ctokens, ctime = self.current
43 stats = PhaseStats(
44 name=cname,
45 tokens=tokens - ctokens,
46 time=now - ctime,
47 )
48 self.phases.append(stats)
49
50 def phase(self, name: str, tokens: int = 0):
51 """

Callers 2

generate_allMethod · 0.95
phaseMethod · 0.95

Calls 1

PhaseStatsClass · 0.85

Tested by

no test coverage detected