You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Pull Request
### What change is being made
One line progress bar.
### Why this change is being made
Better user experience.
### Tested
Run evaluator.
GitOrigin-RevId: 7c91a507c1dc1817da990f265a3eb762988e8490
"""Compare outputs from environment and ONNX model.
69
68
70
69
Args:
@@ -76,60 +75,64 @@ def _compare_step_outputs(
76
75
env_outputs: Environment outputs.
77
76
ort_outputs: ONNX model outputs (None if session not run yet).
78
77
output_names: Names of output components.
79
-
verbose: Whether to print comparison results.
80
78
atol: Absolute tolerance.
81
79
rtol: Relative tolerance.
82
80
83
81
Returns:
84
-
True if all comparisons passed, False otherwise.
82
+
A tuple of (is_step_export_ok, message), where `is_step_export_ok` is a boolean indicating whether the step's outputs are close within the specified tolerances, and `message` is a string describing the comparison results, including details of any mismatches and troubleshooting checklists.
Copy file name to clipboardExpand all lines: exporter/exporter/utils/math.py
+7-10Lines changed: 7 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,7 @@ def compare_tensors(
13
13
name_b: str=None,
14
14
atol: float=1.0e-5,
15
15
rtol: float=1.0e-5,
16
-
verbose: bool=False,
17
-
) ->bool:
16
+
) ->tuple[bool, str]:
18
17
"""Compare two tensors, and print a message showing the differences.
19
18
20
19
Args:
@@ -23,18 +22,19 @@ def compare_tensors(
23
22
vec_name: A name identifying the compared tensors.
24
23
index_names: A list of names, one for each element of the input tensors.
25
24
name_a: A name identifying the source of the first input tensor.
26
-
name_a: A name identifying the source of the second input tensor.
25
+
name_b: A name identifying the source of the second input tensor.
27
26
atol : Absolute tolerance.
28
27
rtol : Relative tolerance.
29
-
verbose: If true, print information about the tensor difference to console.
28
+
29
+
Returns:
30
+
A tuple of (is_close, message), where `is_close` is a boolean indicating whether the tensors are close within the specified tolerances, and `message` is a string describing the comparison results, including details of any mismatches.
0 commit comments