Skip to content

Commit 59f7665

Browse files
committed
mypy
1 parent b637ac7 commit 59f7665

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

onnx_diagnostic/helpers/rt_helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def generate_and_validate(
200200

201201
if session:
202202
diff = max_diff(outputs, onnx_results)
203-
assert diff["abs"] <= atol, (
203+
assert isinstance(diff["abs"], float) and diff["abs"] <= atol, (
204204
f"Unexpected issue with {type(model)}\ndiff={diff}"
205205
f"\ninput_ids.shape={input_ids.shape}"
206206
f"\nexpected={string_type(outputs, with_shape=True, with_min_max=True)}"
@@ -243,7 +243,7 @@ def generate_and_validate(
243243
)
244244
if session:
245245
diff = max_diff(outputs, onnx_results)
246-
assert diff["abs"] <= atol, (
246+
assert isinstance(diff["abs"], float) and diff["abs"] <= atol, (
247247
f"Unexpected issue with {type(model)}, iteration={iteration}"
248248
f"\ndiff={diff}\ninput_ids.shape={input_ids.shape}"
249249
f"\nexpected={string_type(outputs, with_shape=True, with_min_max=True)}"

0 commit comments

Comments
 (0)