Skip to content
This repository was archived by the owner on Mar 12, 2024. It is now read-only.

Commit 091a817

Browse files
Removed a manual indexer iterator pitfall (#454)
* Removed a manual iterator indexer pitfall * Removed a manual iterator indexer pitfall
1 parent b9048eb commit 091a817

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test_all.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ def to_numpy(tensor):
166166
# compute onnxruntime output prediction
167167
ort_inputs = dict((ort_session.get_inputs()[i].name, inpt) for i, inpt in enumerate(inputs))
168168
ort_outs = ort_session.run(None, ort_inputs)
169-
for i in range(0, len(outputs)):
169+
for i, element in enumerate(outputs):
170170
try:
171-
torch.testing.assert_allclose(outputs[i], ort_outs[i], rtol=1e-03, atol=1e-05)
171+
torch.testing.assert_allclose(element, ort_outs[i], rtol=1e-03, atol=1e-05)
172172
except AssertionError as error:
173173
if tolerate_small_mismatch:
174174
self.assertIn("(0.00%)", str(error), str(error))

0 commit comments

Comments
 (0)