Skip to content

Commit c5acc39

Browse files
xiaofeihan1naomiOvad
authored andcommitted
fix np.testing argument order (microsoft#26128)
### Description The argument order of np.testing was incorrect. ### Motivation and Context Before, the expected result and the actual result are reversed. <img width="1285" height="697" alt="image" src="https://github.com/user-attachments/assets/0a464008-9704-46f3-a04d-912ba5b41892" />
1 parent 764c5b1 commit c5acc39

14 files changed

+72
-72
lines changed

onnxruntime/python/tools/tensorrt/perf/benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ def validate(all_ref_outputs, all_outputs, rtol, atol, percent_mismatch):
613613
for ref_o, o in zip(ref_output, output, strict=False):
614614
# abs(desired-actual) < rtol * abs(desired) + atol
615615
try:
616-
np.testing.assert_allclose(ref_o, o, rtol, atol)
616+
np.testing.assert_allclose(o, ref_o, rtol, atol)
617617
except Exception as e:
618618
if percentage_in_allowed_threshold(e, percent_mismatch):
619619
continue

onnxruntime/test/python/onnx_backend_test_series.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ def assert_similar_outputs(cls, ref_outputs, outputs, rtol, atol, model_dir=None
4343
"""
4444

4545
def assert_similar_array(ref_output, output):
46-
np.testing.assert_equal(ref_output.dtype, output.dtype)
46+
np.testing.assert_equal(output.dtype, ref_output.dtype)
4747
if ref_output.dtype == object:
48-
np.testing.assert_array_equal(ref_output, output)
48+
np.testing.assert_array_equal(output, ref_output)
4949
else:
50-
np.testing.assert_allclose(ref_output, output, rtol=rtol, atol=atol)
50+
np.testing.assert_allclose(output, ref_output, rtol=rtol, atol=atol)
5151

52-
np.testing.assert_equal(len(ref_outputs), len(outputs))
52+
np.testing.assert_equal(len(outputs), len(ref_outputs))
5353
for i in range(len(outputs)): # pylint: disable=consider-using-enumerate
5454
if isinstance(outputs[i], list):
5555
for j in range(len(outputs[i])):

onnxruntime/test/python/onnxruntime_test_python.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def run_model(self, session_object, run_options):
5454
input_name = session_object.get_inputs()[0].name
5555
res = session_object.run([], {input_name: x}, run_options=run_options)
5656
output_expected = np.array([[1.0, 4.0], [9.0, 16.0], [25.0, 36.0]], dtype=np.float32)
57-
np.testing.assert_allclose(output_expected, res[0], rtol=1e-05, atol=1e-08)
57+
np.testing.assert_allclose(res[0], output_expected, rtol=1e-05, atol=1e-08)
5858

5959
def run_model_with_input(self, session_object, input_name, input_value, iter_num, queue):
6060
for _ in range(iter_num):
@@ -714,7 +714,7 @@ def test_run_model(self):
714714

715715
res = sess.run([outputs[0].name], {inputs[0].name: x})
716716
output_expected = np.array([[1.0, 4.0], [9.0, 16.0], [25.0, 36.0]], dtype=np.float32)
717-
np.testing.assert_allclose(output_expected, res[0], rtol=1e-05, atol=1e-08)
717+
np.testing.assert_allclose(res[0], output_expected, rtol=1e-05, atol=1e-08)
718718

719719
def test_run_async(self):
720720
event = threading.Event()
@@ -733,7 +733,7 @@ def callback(res: np.ndarray, data: MyData, err: str) -> None:
733733
self.assertEqual(len(err), 0)
734734
self.assertEqual(len(res), 1)
735735
self.assertEqual(data.get_id(), 123456)
736-
np.testing.assert_allclose(output_expected, res[0], rtol=1e-05, atol=1e-08)
736+
np.testing.assert_allclose(res[0], output_expected, rtol=1e-05, atol=1e-08)
737737
event.set()
738738

739739
so = onnxrt.SessionOptions()
@@ -762,7 +762,7 @@ def test_run_model_from_bytes(self):
762762
self.assertEqual(output_shape, [3, 2])
763763
res = sess.run([output_name], {input_name: x})
764764
output_expected = np.array([[1.0, 4.0], [9.0, 16.0], [25.0, 36.0]], dtype=np.float32)
765-
np.testing.assert_allclose(output_expected, res[0], rtol=1e-05, atol=1e-08)
765+
np.testing.assert_allclose(res[0], output_expected, rtol=1e-05, atol=1e-08)
766766

767767
def test_run_model2(self):
768768
sess = onnxrt.InferenceSession(get_name("matmul_1.onnx"), providers=onnxrt.get_available_providers())
@@ -777,7 +777,7 @@ def test_run_model2(self):
777777
self.assertEqual(output_shape, [3, 1])
778778
res = sess.run([output_name], {input_name: x})
779779
output_expected = np.array([[5.0], [11.0], [17.0]], dtype=np.float32)
780-
np.testing.assert_allclose(output_expected, res[0], rtol=1e-05, atol=1e-08)
780+
np.testing.assert_allclose(res[0], output_expected, rtol=1e-05, atol=1e-08)
781781

782782
def test_run_model2_contiguous(self):
783783
sess = onnxrt.InferenceSession(get_name("matmul_1.onnx"), providers=onnxrt.get_available_providers())
@@ -792,10 +792,10 @@ def test_run_model2_contiguous(self):
792792
self.assertEqual(output_shape, [3, 1])
793793
res = sess.run([output_name], {input_name: x})
794794
output_expected = np.array([[5.0], [11.0], [17.0]], dtype=np.float32)
795-
np.testing.assert_allclose(output_expected, res[0], rtol=1e-05, atol=1e-08)
795+
np.testing.assert_allclose(res[0], output_expected, rtol=1e-05, atol=1e-08)
796796
xcontiguous = np.ascontiguousarray(x)
797797
rescontiguous = sess.run([output_name], {input_name: xcontiguous})
798-
np.testing.assert_allclose(output_expected, rescontiguous[0], rtol=1e-05, atol=1e-08)
798+
np.testing.assert_allclose(rescontiguous[0], output_expected, rtol=1e-05, atol=1e-08)
799799

800800
def test_run_model_multiple_threads(self):
801801
# Skip this test for a "pure" DML onnxruntime python wheel.
@@ -860,14 +860,14 @@ def test_list_as_input(self):
860860
input_name = sess.get_inputs()[0].name
861861
res = sess.run([], {input_name: x.tolist()})
862862
output_expected = np.array([[1.0, 4.0], [9.0, 16.0], [25.0, 36.0]], dtype=np.float32)
863-
np.testing.assert_allclose(output_expected, res[0], rtol=1e-05, atol=1e-08)
863+
np.testing.assert_allclose(res[0], output_expected, rtol=1e-05, atol=1e-08)
864864

865865
def test_string_list_as_input(self):
866866
sess = onnxrt.InferenceSession(get_name("identity_string.onnx"), providers=available_providers_without_tvm)
867867
x = np.array(["this", "is", "identity", "test"], dtype=str).reshape((2, 2))
868868
x_name = sess.get_inputs()[0].name
869869
res = sess.run([], {x_name: x.tolist()})
870-
np.testing.assert_equal(x, res[0])
870+
np.testing.assert_equal(res[0], x)
871871

872872
def test_run_device(self):
873873
device = onnxrt.get_device()
@@ -888,7 +888,7 @@ def test_run_model_symbolic_input(self):
888888
self.assertEqual(output_shape, ["None", 1])
889889
res = sess.run([output_name], {input_name: x})
890890
output_expected = np.array([[5.0], [11.0], [17.0]], dtype=np.float32)
891-
np.testing.assert_allclose(output_expected, res[0], rtol=1e-05, atol=1e-08)
891+
np.testing.assert_allclose(res[0], output_expected, rtol=1e-05, atol=1e-08)
892892

893893
def test_boolean_inputs(self):
894894
sess = onnxrt.InferenceSession(get_name("logicaland.onnx"), providers=available_providers)
@@ -920,7 +920,7 @@ def test_boolean_inputs(self):
920920

921921
output_expected = np.array([[True, False], [False, False]], dtype=bool)
922922
res = sess.run([output_name], {a_name: a, b_name: b})
923-
np.testing.assert_equal(output_expected, res[0])
923+
np.testing.assert_equal(res[0], output_expected)
924924

925925
def test_string_input1(self):
926926
sess = onnxrt.InferenceSession(get_name("identity_string.onnx"), providers=available_providers_without_tvm)
@@ -941,7 +941,7 @@ def test_string_input1(self):
941941
self.assertEqual(output_type, "tensor(string)")
942942

943943
res = sess.run([output_name], {x_name: x})
944-
np.testing.assert_equal(x, res[0])
944+
np.testing.assert_equal(res[0], x)
945945

946946
def test_string_input2(self):
947947
sess = onnxrt.InferenceSession(get_name("identity_string.onnx"), providers=available_providers_without_tvm)
@@ -962,7 +962,7 @@ def test_string_input2(self):
962962
self.assertEqual(output_type, "tensor(string)")
963963

964964
res = sess.run([output_name], {x_name: x})
965-
np.testing.assert_equal(x, res[0])
965+
np.testing.assert_equal(res[0], x)
966966

967967
def test_input_bytes(self):
968968
sess = onnxrt.InferenceSession(get_name("identity_string.onnx"), providers=available_providers_without_tvm)
@@ -983,7 +983,7 @@ def test_input_bytes(self):
983983
self.assertEqual(output_type, "tensor(string)")
984984

985985
res = sess.run([output_name], {x_name: x})
986-
np.testing.assert_equal(x, res[0].astype("|S8"))
986+
np.testing.assert_equal(res[0].astype("|S8"), x)
987987

988988
def test_input_object(self):
989989
sess = onnxrt.InferenceSession(get_name("identity_string.onnx"), providers=available_providers_without_tvm)
@@ -1004,7 +1004,7 @@ def test_input_object(self):
10041004
self.assertEqual(output_type, "tensor(string)")
10051005

10061006
res = sess.run([output_name], {x_name: x})
1007-
np.testing.assert_equal(x, res[0])
1007+
np.testing.assert_equal(res[0], x)
10081008

10091009
def test_input_void(self):
10101010
sess = onnxrt.InferenceSession(get_name("identity_string.onnx"), providers=available_providers_without_tvm)
@@ -1029,7 +1029,7 @@ def test_input_void(self):
10291029
res = sess.run([output_name], {x_name: x})
10301030

10311031
expr = np.array([["must", "have"], ["same", "size"]], dtype=object)
1032-
np.testing.assert_equal(expr, res[0])
1032+
np.testing.assert_equal(res[0], expr)
10331033

10341034
def test_raise_wrong_num_inputs(self):
10351035
with self.assertRaises(ValueError) as context:
@@ -1164,7 +1164,7 @@ def test_sequence_construct(self):
11641164
},
11651165
)
11661166

1167-
np.testing.assert_array_equal(output_expected, res[0])
1167+
np.testing.assert_array_equal(res[0], output_expected)
11681168

11691169
def test_sequence_insert(self):
11701170
opt = onnxrt.SessionOptions()
@@ -1194,7 +1194,7 @@ def test_sequence_insert(self):
11941194
"input_seq": [],
11951195
},
11961196
)
1197-
np.testing.assert_array_equal(output_expected, res[0])
1197+
np.testing.assert_array_equal(res[0], output_expected)
11981198

11991199
def test_ort_execution_mode(self):
12001200
opt = onnxrt.SessionOptions()
@@ -1375,7 +1375,7 @@ def test_register_custom_ops_library(self):
13751375
input_1 = np.zeros((3, 5)).astype(np.float32)
13761376
res = sess1.run([output_name], {input_name_0: input_0, input_name_1: input_1})
13771377
output_expected = np.ones((3, 5)).astype(np.float32)
1378-
np.testing.assert_allclose(output_expected, res[0], rtol=1e-05, atol=1e-08)
1378+
np.testing.assert_allclose(res[0], output_expected, rtol=1e-05, atol=1e-08)
13791379

13801380
# Create an alias of SessionOptions instance
13811381
# We will use this alias to construct another InferenceSession
@@ -1969,7 +1969,7 @@ def test_adater_export_read(self):
19691969
self.assertTrue(value.is_tensor())
19701970
self.assertEqual(expected_val.element_type(), value.element_type())
19711971
self.assertEqual(expected_val.shape(), value.shape())
1972-
np.testing.assert_allclose(expected_val.numpy(), value.numpy())
1972+
np.testing.assert_allclose(value.numpy(), expected_val.numpy())
19731973

19741974
def test_run_with_adapter(self):
19751975
model_path = get_name("lora/two_params_lora_model.onnx")

onnxruntime/test/python/onnxruntime_test_python_autoep.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def test_cuda_ep_register_and_inference(self):
6666
input_name = sess.get_inputs()[0].name
6767
res = sess.run([], {input_name: x})
6868
output_expected = np.array([[1.0, 4.0], [9.0, 16.0], [25.0, 36.0]], dtype=np.float32)
69-
np.testing.assert_allclose(output_expected, res[0], rtol=1e-05, atol=1e-08)
69+
np.testing.assert_allclose(res[0], output_expected, rtol=1e-05, atol=1e-08)
7070

7171
del sess # Delete session before unregistering library
7272
self.unregister_execution_provider_library(ep_name)
@@ -98,7 +98,7 @@ def test_cuda_prefer_gpu_and_inference(self):
9898
input_name = sess.get_inputs()[0].name
9999
res = sess.run([], {input_name: x})
100100
output_expected = np.array([[1.0, 4.0], [9.0, 16.0], [25.0, 36.0]], dtype=np.float32)
101-
np.testing.assert_allclose(output_expected, res[0], rtol=1e-05, atol=1e-08)
101+
np.testing.assert_allclose(res[0], output_expected, rtol=1e-05, atol=1e-08)
102102

103103
del sess # Delete session before unregistering library
104104
self.unregister_execution_provider_library(ep_name)
@@ -146,7 +146,7 @@ def my_delegate(
146146
input_name = sess.get_inputs()[0].name
147147
res = sess.run([], {input_name: x})
148148
output_expected = np.array([[1.0, 4.0], [9.0, 16.0], [25.0, 36.0]], dtype=np.float32)
149-
np.testing.assert_allclose(output_expected, res[0], rtol=1e-05, atol=1e-08)
149+
np.testing.assert_allclose(res[0], output_expected, rtol=1e-05, atol=1e-08)
150150

151151
del sess # Delete session before unregistering library
152152
self.unregister_execution_provider_library(ep_name)
@@ -249,7 +249,7 @@ def test_example_plugin_ep_devices(self):
249249
input_name = sess.get_inputs()[0].name
250250
res = sess.run([], {input_name: x})
251251
output_expected = np.array([[1.0, 4.0], [9.0, 16.0], [25.0, 36.0]], dtype=np.float32)
252-
np.testing.assert_allclose(output_expected, res[0], rtol=1e-05, atol=1e-08)
252+
np.testing.assert_allclose(res[0], output_expected, rtol=1e-05, atol=1e-08)
253253

254254
del sess # Delete session before unregistering library
255255
self.unregister_execution_provider_library(ep_name)
@@ -282,11 +282,11 @@ def test_example_plugin_ep_data_transfer(self):
282282
gpu_value = onnxrt.OrtValue.ortvalue_from_numpy(data, "gpu", 0, 0xBE57)
283283
# copy back to CPU
284284
cpu_data = gpu_value.numpy()
285-
np.testing.assert_equal(data, cpu_data)
285+
np.testing.assert_equal(cpu_data, data)
286286

287287
gpu_value.update_inplace(data2) # update the fake GPU data
288288
cpu_data_2 = gpu_value.numpy() # copy back to CPU
289-
np.testing.assert_equal(data2, cpu_data_2)
289+
np.testing.assert_equal(cpu_data_2, data2)
290290

291291
gpu_value = None # Delete OrtValue before unregistering library as the allocator will be destroyed.
292292

@@ -336,8 +336,8 @@ def test_copy_tensors(self):
336336
del b_device
337337

338338
# Verify the contents
339-
np.testing.assert_array_equal(a, a_cpu_copy.numpy())
340-
np.testing.assert_array_equal(b, b_cpu_copy.numpy())
339+
np.testing.assert_array_equal(a_cpu_copy.numpy(), a)
340+
np.testing.assert_array_equal(b_cpu_copy.numpy(), b)
341341

342342
self.unregister_execution_provider_library(ep_name)
343343

onnxruntime/test/python/onnxruntime_test_python_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_run_model(self):
1919
x = np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]], dtype=np.float32)
2020
res = rep.run(x)
2121
output_expected = np.array([[1.0, 4.0], [9.0, 16.0], [25.0, 36.0]], dtype=np.float32)
22-
np.testing.assert_allclose(output_expected, res[0], rtol=1e-05, atol=1e-08)
22+
np.testing.assert_allclose(res[0], output_expected, rtol=1e-05, atol=1e-08)
2323

2424
def test_allocation_plan_works_with_only_execute_path_to_fetches_option(self):
2525
"""

onnxruntime/test/python/onnxruntime_test_python_backend_mlops.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def check_list_of_map_to_float(testcase, expected_rows, actual_rows):
2323
for i in range(num_rows):
2424
# use np.testing.assert_allclose so we can specify the tolerance
2525
np.testing.assert_allclose(
26-
[expected_rows[i][key] for key in sorted_keys],
2726
[actual_rows[i][key] for key in sorted_keys],
27+
[expected_rows[i][key] for key in sorted_keys],
2828
rtol=1e-05,
2929
atol=1e-07,
3030
)
@@ -37,7 +37,7 @@ def test_run_model_non_tensor(self):
3737
x = {0: 25.0, 1: 5.13, 2: 0.0, 3: 0.453, 4: 5.966}
3838
res = rep.run(x)
3939
output_expected = np.array([[49.752754]], dtype=np.float32)
40-
np.testing.assert_allclose(output_expected, res[0], rtol=1e-05, atol=1e-08)
40+
np.testing.assert_allclose(res[0], output_expected, rtol=1e-05, atol=1e-08)
4141

4242
def test_run_model_proto(self):
4343
name = datasets.get_example("logreg_iris.onnx")
@@ -47,7 +47,7 @@ def test_run_model_proto(self):
4747
x = np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]], dtype=np.float32)
4848
res = rep.run(x)
4949
output_expected = np.array([0, 0, 0], dtype=np.float32)
50-
np.testing.assert_allclose(output_expected, res[0], rtol=1e-05, atol=1e-08)
50+
np.testing.assert_allclose(res[0], output_expected, rtol=1e-05, atol=1e-08)
5151
output_expected = [
5252
{0: 0.950599730014801, 1: 0.027834169566631317, 2: 0.02156602405011654},
5353
{
@@ -72,7 +72,7 @@ def test_run_model_proto_api(self):
7272
outputs = ort_backend.run_model(model, inputs)
7373

7474
output_expected = np.array([0, 0, 0], dtype=np.float32)
75-
np.testing.assert_allclose(output_expected, outputs[0], rtol=1e-05, atol=1e-08)
75+
np.testing.assert_allclose(outputs[0], output_expected, rtol=1e-05, atol=1e-08)
7676
output_expected = [
7777
{0: 0.950599730014801, 1: 0.027834169566631317, 2: 0.02156602405011654},
7878
{

onnxruntime/test/python/onnxruntime_test_python_cudagraph.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,18 @@ class TestInferenceSessionWithCudaGraph(unittest.TestCase):
6363
def test_ort_value_update_in_place(self):
6464
x0 = np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]], dtype=np.float32)
6565
ortvalue_cpu = onnxrt.OrtValue.ortvalue_from_numpy(x0)
66-
np.testing.assert_allclose(x0, ortvalue_cpu.numpy())
66+
np.testing.assert_allclose(ortvalue_cpu.numpy(), x0)
6767

6868
x1 = np.array([[10.0, 20.0], [30.0, 40.0], [50.0, 60.0]], dtype=np.float32)
6969
ortvalue_cpu.update_inplace(x1)
70-
np.testing.assert_allclose(x1, ortvalue_cpu.numpy())
70+
np.testing.assert_allclose(ortvalue_cpu.numpy(), x1)
7171

7272
if "CUDAExecutionProvider" in onnxrt.get_available_providers():
7373
ortvalue_gpu = onnxrt.OrtValue.ortvalue_from_numpy(x0, "cuda", 0)
74-
np.testing.assert_allclose(x0, ortvalue_gpu.numpy())
74+
np.testing.assert_allclose(ortvalue_gpu.numpy(), x0)
7575

7676
ortvalue_gpu.update_inplace(x1)
77-
np.testing.assert_allclose(x1, ortvalue_gpu.numpy())
77+
np.testing.assert_allclose(ortvalue_gpu.numpy(), x1)
7878

7979
def test_select_ep_to_run_cuda_graph(self):
8080
if "TensorrtExecutionProvider" in onnxrt.get_available_providers():
@@ -105,11 +105,11 @@ def run_model_with_cuda_graph(self, providers):
105105
# One regular run for the necessary memory allocation and cuda graph capturing
106106
session.run_with_iobinding(io_binding, ro)
107107
expected_y = np.array([[5.0], [11.0], [17.0]] * INPUT_SIZE, dtype=np.float32)
108-
np.testing.assert_allclose(expected_y, y_ortvalue.numpy(), rtol=1e-05, atol=1e-05)
108+
np.testing.assert_allclose(y_ortvalue.numpy(), expected_y, rtol=1e-05, atol=1e-05)
109109

110110
# After capturing, CUDA graph replay happens from this Run onwards
111111
session.run_with_iobinding(io_binding, ro)
112-
np.testing.assert_allclose(expected_y, y_ortvalue.numpy(), rtol=1e-05, atol=1e-05)
112+
np.testing.assert_allclose(y_ortvalue.numpy(), expected_y, rtol=1e-05, atol=1e-05)
113113

114114
# Update input and then replay CUDA graph
115115
x_ortvalue.update_inplace(
@@ -120,8 +120,8 @@ def run_model_with_cuda_graph(self, providers):
120120
)
121121
session.run_with_iobinding(io_binding, ro)
122122
np.testing.assert_allclose(
123-
np.array([[50.0], [110.0], [170.0]] * INPUT_SIZE, dtype=np.float32),
124123
y_ortvalue.numpy(),
124+
np.array([[50.0], [110.0], [170.0]] * INPUT_SIZE, dtype=np.float32),
125125
rtol=1e-05,
126126
atol=1e-05,
127127
)
@@ -162,7 +162,7 @@ def run_model_with_cuda_graph_annotation(self, providers):
162162
session.run_with_iobinding(io_bindings[i], ro)
163163
io_bindings[i].synchronize_outputs()
164164
expected_y = np.array(expected_y_base[: i + 1][:] * INPUT_SIZE, dtype=np.float32)
165-
np.testing.assert_allclose(expected_y, y_ortvalues[i].numpy(), rtol=1e-05, atol=1e-05)
165+
np.testing.assert_allclose(y_ortvalues[i].numpy(), expected_y, rtol=1e-05, atol=1e-05)
166166

167167
del ro
168168
ro = onnxrt.RunOptions()
@@ -176,7 +176,7 @@ def run_model_with_cuda_graph_annotation(self, providers):
176176
session.run_with_iobinding(io_bindings[i], ro)
177177
io_bindings[i].synchronize_outputs()
178178
expected_y = np.array(expected_y_base_mul_10[: i + 1][:] * INPUT_SIZE, dtype=np.float32)
179-
np.testing.assert_allclose(expected_y, y_ortvalues[i].numpy(), rtol=1e-05, atol=1e-05)
179+
np.testing.assert_allclose(y_ortvalues[i].numpy(), expected_y, rtol=1e-05, atol=1e-05)
180180

181181
def test_arena_with_cuda_graph(self):
182182
if "CUDAExecutionProvider" in onnxrt.get_available_providers():
@@ -214,7 +214,7 @@ def test_arena_with_cuda_graph(self):
214214
session.run_with_iobinding(io_binding)
215215
output = cuda_graph_helper.get_output("softmaxout_1")
216216

217-
np.testing.assert_allclose(expected_output, output, rtol=1e-02, atol=1e-02)
217+
np.testing.assert_allclose(output, expected_output, rtol=1e-02, atol=1e-02)
218218

219219

220220
if __name__ == "__main__":

0 commit comments

Comments
 (0)