Skip to content

Commit 30105dc

Browse files
committed
Add test guards
1 parent 3913fe1 commit 30105dc

File tree

5 files changed

+26
-16
lines changed

5 files changed

+26
-16
lines changed

tests/python/contrib/test_ethosu/cascader/test_ethosu_binary_elementwise_matcher.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,20 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17+
import pytest
18+
19+
pytest.importorskip("ethosu.vela")
20+
21+
import numpy as np
22+
import math
23+
1724
from tvm import te
1825
import tvm.contrib.ethosu.cascader as cs
1926
from tvm.relay.backend.contrib.ethosu.te.binary_elementwise import (
2027
match_ethosu_binary_elementwise,
2128
binary_elementwise_compute,
2229
)
2330

24-
import numpy as np
25-
import math
26-
import pytest
27-
2831

2932
def _make_matrices(broadcast, ifm_layout, ifm2_layout, ofm_layout):
3033
broadcast_h, broadcast_w, broadcast_c = broadcast

tests/python/contrib/test_ethosu/cascader/test_ethosu_conv2d_matcher.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
from .infra import make_matrices
2626

27-
import pytest
28-
2927

3028
@pytest.mark.parametrize("kernel", [(3, 3), (2, 1), (3, 5)])
3129
@pytest.mark.parametrize("stride", [(1, 1), (2, 1), (3, 2)])

tests/python/contrib/test_ethosu/cascader/test_ethosu_depthwise2d_matcher.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17+
import pytest
18+
19+
pytest.importorskip("ethosu.vela")
20+
21+
import numpy as np
22+
1723
from tvm import te
1824
import tvm.contrib.ethosu.cascader as cs
1925
from tvm.relay.backend.contrib.ethosu.te.depthwise import (
@@ -22,9 +28,6 @@
2228
)
2329
from .infra import make_matrices
2430

25-
import numpy as np
26-
import pytest
27-
2831

2932
@pytest.mark.parametrize("kernel", [(3, 3), (2, 1), (3, 5)])
3033
@pytest.mark.parametrize("stride", [(1, 1), (2, 1), (3, 2)])

tests/python/contrib/test_ethosu/cascader/test_ethosu_pooling_matcher.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17+
import pytest
18+
19+
pytest.importorskip("ethosu.vela")
20+
21+
import numpy as np
22+
1723
from tvm import te
1824
import tvm.contrib.ethosu.cascader as cs
1925
from tvm.relay.backend.contrib.ethosu.te.pooling import match_ethosu_pooling, pooling_compute
2026
from .infra import make_matrices
2127

22-
import numpy as np
23-
import pytest
24-
2528

2629
@pytest.mark.parametrize("pool_shape", [(3, 3), (2, 1), (3, 5)])
2730
@pytest.mark.parametrize("stride", [(1, 1), (2, 1), (3, 2)])

tests/python/contrib/test_ethosu/cascader/test_ethosu_unary_elementwise_matcher.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,20 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17+
import pytest
18+
19+
pytest.importorskip("ethosu.vela")
20+
21+
import numpy as np
22+
import math
23+
1724
from tvm import te
1825
import tvm.contrib.ethosu.cascader as cs
1926
from tvm.relay.backend.contrib.ethosu.te.unary_elementwise import (
2027
match_ethosu_unary_elementwise,
2128
unary_elementwise_compute,
2229
)
2330

24-
import numpy as np
25-
import math
26-
import pytest
27-
2831

2932
def _make_matrices(ifm_layout, ofm_layout):
3033
nhwc_to_nhcwb16 = [

0 commit comments

Comments
 (0)