Skip to content

Commit b1eb293

Browse files
committed
Add timestamp in log.
1 parent 9cf8a86 commit b1eb293

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

graph_net/torch/collect_stats.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import importlib
88
import inspect
99
import subprocess
10+
from datetime import datetime
1011
from typing import Type
1112
from dataclasses import dataclass, field
1213
from collections import defaultdict
@@ -518,7 +519,10 @@ def main(args):
518519
if args.model_path is not None:
519520
assert os.path.isdir(args.model_path)
520521
assert is_single_model_dir(args.model_path)
521-
print(f"Collect information for {args.model_path}")
522+
timestamp_sec = datetime.now().timestamp()
523+
dt = datetime.fromtimestamp(timestamp_sec)
524+
formatted_dt = dt.strftime("%Y-%m-%d %H:%M:%S.%f")[:-3]
525+
print(f"[{formatted_dt}] Collect information for {args.model_path}")
522526
collect_model_stats(args.model_path, args.device, args.log_prompt)
523527
else:
524528
graph_net_samples_path = (

0 commit comments

Comments
 (0)