Skip to content

Commit

Permalink
Remove outdated skips | test (#927)
Browse files Browse the repository at this point in the history
Remove outdated skips in function tests which were skipping ONNX 1.13 or
torch 1.13.
  • Loading branch information
justinchuby authored Oct 26, 2023
1 parent 754accc commit ab5a1bc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 36 deletions.
6 changes: 5 additions & 1 deletion onnxscript/converter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -270,7 +271,10 @@ def test_renaming(self):

self.validate_save(renaming, shape_inference=False)

@unittest.skip(reason="TypeError: val must be numeric not <class 'NoneType'>")
@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

Expand Down
2 changes: 0 additions & 2 deletions onnxscript/function_libs/torch_lib/graph_building_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 2 additions & 26 deletions onnxscript/tests/functions/onnxfns1A_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import unittest

import onnx
import pytest

from onnxscript.tests.common import onnx_script_test_case
Expand All @@ -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)

Expand All @@ -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)
Expand Down
6 changes: 0 additions & 6 deletions onnxscript/tests/functions/onnxfns_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

import unittest

import onnx

from onnxscript.tests.common import onnx_script_test_case
from onnxscript.tests.models import onnxfns1

Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
setuptools>=61.0.0
numpy
onnx-weekly==1.15.0.dev20230807
onnxruntime
onnxruntime>=1.15.1
typing_extensions

# Docs site
Expand Down

0 comments on commit ab5a1bc

Please sign in to comment.