no numpy change if no NPY (#9281)

* skip np change check if no NPY

* use any
This commit is contained in:
ZwX1616
2025-02-27 17:32:35 -08:00
committed by GitHub
parent 3b9950241e
commit c977781b3c

View File

@@ -92,10 +92,11 @@ def test_vs_compile(run, new_inputs, test_val=None):
print("**** test done ****")
# test that changing the numpy changes the model outputs
for v in new_inputs_numpy.values(): v *= 2
out = run(**inputs)
changed_val = out.numpy()
np.testing.assert_raises(AssertionError, np.testing.assert_array_equal, val, changed_val)
if any([x.device == 'NPY' for x in inputs.values()]):
for v in new_inputs_numpy.values(): v *= 2
out = run(**inputs)
changed_val = out.numpy()
np.testing.assert_raises(AssertionError, np.testing.assert_array_equal, val, changed_val)
return val
def test_vs_onnx(new_inputs, test_val, onnx_file, ort=False):