Append one structured row (frames + sps + caller's scalars) to metrics.jsonl.
(self, frames, scalars)
| 80 | self.ckpt_last, self.ms_last, self.best = 0, 0, float("-inf") |
| 81 | |
| 82 | def log(self, frames, scalars): |
| 83 | """Append one structured row (frames + sps + caller's scalars) to metrics.jsonl.""" |
| 84 | if not self.f: |
| 85 | return |
| 86 | now = time.time() |
| 87 | sps = (frames - self.last_frames) / max(now - self.t0, 1e-9) |
| 88 | self.f.write(json.dumps({"ts": round(now, 1), "frames": frames, "sps": round(sps, 1), **scalars}) + "\n") |
| 89 | self.t0, self.last_frames = now, frames |
| 90 | |
| 91 | def resolve_resume(self, resume_arg): |
| 92 | """'auto' -> run_dir/ckpt/latest.pt, else a path, else None.""" |
no outgoing calls
no test coverage detected