class_docstr: Generation stats, split by phases.
docstr: Terminate the current phase.
code: def end_phase(self, tokens: int, now: Optional[float] = None):
      """Terminate the current phase."""
      if self.current is None:
          return
      if now is None:
          now = time.time()
      cname, ctokens, ctime = self.current
      stats = PhaseStats(
          name=cname,
          tokens=tokens - ctokens,
          time=now - ctime,
      )
      self.phases.append(stats)
  
file_path: xformers/examples/llama_inference/stats.py
imports: import time
  from dataclasses import dataclass
  from typing import Optional
label_desc: Use image node_id 2 for calling the Stats obj's underlying member method code with example usage: obj.end_phase(tokens, now) without return types