Skip to content

Commit 0e5e11d

Browse files
committed
mypy
1 parent 83a272c commit 0e5e11d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

onnx_diagnostic/ext_test_case.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,9 @@ def assert_onnx_disc(
11951195
if verbose:
11961196
print(f"[{vname}] diff {string_diff(diff)}")
11971197
assert (
1198-
not numpy.isnan(diff["abs"])
1198+
isinstance(diff["abs"], float)
1199+
and isinstance(diff["rel"], float)
1200+
and not numpy.isnan(diff["abs"])
11991201
and diff["abs"] <= atol
12001202
and not numpy.isnan(diff["rel"])
12011203
and diff["rel"] <= rtol

onnx_diagnostic/helpers/helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ def max_diff(
12211221
f"_index={_index}"
12221222
)
12231223

1224-
res: Dict[str, Union[int, float, Tuple[int, ...]]] = dict(
1224+
res: Dict[str, float] = dict(
12251225
abs=abs_diff, rel=rel_diff, sum=sum_diff, n=n_diff, dnan=nan_diff, argm=argm
12261226
)
12271227
if hist:
@@ -1332,7 +1332,7 @@ def max_diff(
13321332
f"_index={_index}"
13331333
)
13341334

1335-
res: Dict[str, Union[int, float, Tuple[int, ...]]] = dict(
1335+
res: Dict[str, float] = dict(
13361336
abs=abs_diff, rel=rel_diff, sum=sum_diff, n=n_diff, dnan=nan_diff, argm=argm
13371337
)
13381338
if hist:

0 commit comments

Comments
 (0)