diff --git a/onnxscript/converter_test.py b/onnxscript/converter_test.py index 2e12222ee..6036641ff 100644 --- a/onnxscript/converter_test.py +++ b/onnxscript/converter_test.py @@ -17,6 +17,7 @@ import numpy as np import onnx import onnxruntime as ort +import pytest from onnxruntime.capi.onnxruntime_pybind11_state import ( Fail, InvalidArgument, @@ -270,7 +271,10 @@ def test_renaming(self): self.validate_save(renaming, shape_inference=False) - @unittest.skip(reason="TypeError: val must be numeric not ") + @pytest.mark.xfail( + strict=True, + reason="default_opset must be specified in script for functions that do not contain any use of an ONNX op", + ) def test_opt_output(self): from onnxscript.tests.models import opt_output diff --git a/onnxscript/function_libs/torch_lib/graph_building_test.py b/onnxscript/function_libs/torch_lib/graph_building_test.py index d38bb52d5..ab8b4bc8f 100644 --- a/onnxscript/function_libs/torch_lib/graph_building_test.py +++ b/onnxscript/function_libs/torch_lib/graph_building_test.py @@ -11,11 +11,9 @@ import onnxscript.testing from onnxscript import FLOAT, evaluator from onnxscript import opset18 as op -from onnxscript._internal import version_utils from onnxscript.function_libs.torch_lib import graph_building, ops -@unittest.skipIf(version_utils.torch_older_than("2.0"), "torchscript in 1.13 not supported") class TestTorchScriptTracingEvaluator(unittest.TestCase): def setUp(self): self.opset_version = 18 diff --git a/onnxscript/tests/functions/onnxfns1A_test.py b/onnxscript/tests/functions/onnxfns1A_test.py index 2d3b6287f..09302a634 100644 --- a/onnxscript/tests/functions/onnxfns1A_test.py +++ b/onnxscript/tests/functions/onnxfns1A_test.py @@ -1,6 +1,5 @@ import unittest -import onnx import pytest from onnxscript.tests.common import onnx_script_test_case @@ -16,51 +15,27 @@ def setUpClass(cls): def test_onnxfns_relu(self): self.run_onnx_test(onnxfns1A.Relu) - @unittest.skipIf( - not hasattr(onnx.FunctionProto, "attribute_proto"), - reason="ONNX 1.13 does not support default values", - ) def test_onnxfns_selu(self): self.run_onnx_test(onnxfns1A.Selu) - @unittest.skipIf( - not hasattr(onnx.FunctionProto, "attribute_proto"), - reason="current onnx does not support default values", - ) def test_onnxfns_elu(self): self.run_onnx_test(onnxfns1A.Elu) def test_onnxfns_elu05(self): self.run_onnx_test(onnxfns1A.Elu05) - @unittest.skipIf( - not hasattr(onnx.FunctionProto, "attribute_proto"), - reason="ONNX 1.13 does not support default values", - ) def test_onnxfns_thresholded_relu(self): self.run_onnx_test(onnxfns1A.ThresholdedRelu) - @unittest.skipIf( - not hasattr(onnx.FunctionProto, "attribute_proto"), - reason="ONNX 1.13 does not support default values", - ) def test_onnxfns_leaky_relu(self): self.run_onnx_test(onnxfns1A.LeakyRelu) def test_onnxfns_prelu(self): self.run_onnx_test(onnxfns1A.PRelu) - @unittest.skipIf( - not hasattr(onnx.FunctionProto, "attribute_proto"), - reason="current onnx does not support default values", - ) def test_onnxfns_hard_sigmoid(self): self.run_onnx_test(onnxfns1A.HardSigmoid) - @unittest.skipIf( - not hasattr(onnx.FunctionProto, "attribute_proto"), - reason="current onnx does not support default values", - ) def test_onnxfns_shrink(self): self.run_onnx_test(onnxfns1A.Shrink) @@ -71,7 +46,8 @@ def test_onnxfns_hard_softsign(self): self.run_onnx_test(onnxfns1A.Softsign) @pytest.mark.xfail( - reason="Clip has optional input min and max. Need to find out how to pass default min and max to the test case executor." + strict=True, + reason="Clip has optional input min and max. Need to find out how to pass default min and max to the test case executor.", ) def test_onnxfns_hard_clip(self): self.run_onnx_test(onnxfns1A.Clip) diff --git a/onnxscript/tests/functions/onnxfns_test.py b/onnxscript/tests/functions/onnxfns_test.py index d9bcd80ec..68ae2e3b8 100644 --- a/onnxscript/tests/functions/onnxfns_test.py +++ b/onnxscript/tests/functions/onnxfns_test.py @@ -5,8 +5,6 @@ import unittest -import onnx - from onnxscript.tests.common import onnx_script_test_case from onnxscript.tests.models import onnxfns1 @@ -57,10 +55,6 @@ def test_onnxfns_hard_softplus(self): def test_onnxfns_hard_softsign(self): self.run_onnx_test(onnxfns1.Softsign) - @unittest.skipIf( - not hasattr(onnx.FunctionProto, "attribute_proto"), - reason="current onnx does not support default values", - ) def test_onnxfns_hard_clip(self): self.run_onnx_test( onnxfns1.Clip, diff --git a/requirements-dev.txt b/requirements-dev.txt index 2292af13e..218ec9715 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ setuptools>=61.0.0 numpy onnx-weekly==1.15.0.dev20230807 -onnxruntime +onnxruntime>=1.15.1 typing_extensions # Docs site