Skip to content

Commit 56a55d4

Browse files
committedApr 8, 2024·
better comments
1 parent 53506d1 commit 56a55d4

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed
 

‎onnx_array_api/_command_lines_parser.py

+6
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,14 @@ def _cmd_compare(argv: List[Any]):
123123

124124
parser = get_parser_compare()
125125
args = parser.parse_args(argv[1:])
126+
if args.verbose in ("1", 1, "True", True):
127+
print(f"[compare] first model {args.model1!r}")
128+
print(f"[compare] second model {args.model2!r}")
126129
onx1 = onnx.load(args.model1)
127130
onx2 = onnx.load(args.model2)
131+
if args.verbose in ("1", 1, "True", True):
132+
print(f"[compare] first model has {len(onx1.graph.node)} nodes")
133+
print(f"[compare] second model has {len(onx2.graph.node)} nodes")
128134
res1, res2, align, dc = compare_onnx_execution(
129135
onx1,
130136
onx2,

‎onnx_array_api/reference/evaluator_yield.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -642,15 +642,16 @@ def compare_onnx_execution(
642642
print("[compare_onnx_execution] loading first model")
643643
proto1 = load(model1) if isinstance(model1, str) else model1
644644
if verbose:
645-
print("[compare_onnx_execution] loading first model")
645+
print("[compare_onnx_execution] loading second model")
646646
proto2 = load(model2) if isinstance(model2, str) else model2
647647
res1 = list(_enumerate_result_no_execution(proto1))
648648
res2 = list(_enumerate_result_no_execution(proto2))
649649
else:
650650
return
651651

652652
if verbose:
653-
print(f"[compare_onnx_execution] got {len(res2)} results")
653+
print(f"[compare_onnx_execution] got {len(res1)} results (first model)")
654+
print(f"[compare_onnx_execution] got {len(res2)} results (second model)")
654655
print("[compare_onnx_execution] compute edit distance")
655656
dc = DistanceExecution()
656657
_, align = dc.distance_sequence(res1, res2)

0 commit comments

Comments
 (0)
Please sign in to comment.