diff --git a/tests/python/contrib/test_ethosu/__init__.py b/tests/python/contrib/test_ethosu/__init__.py new file mode 100644 index 0000000000000..e23e5fc926b24 --- /dev/null +++ b/tests/python/contrib/test_ethosu/__init__.py @@ -0,0 +1,17 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +"""Test infrastructure for Arm(R) Ethos(TM)-U NPU related tests""" diff --git a/tests/python/contrib/test_ethosu/test_codegen.py b/tests/python/contrib/test_ethosu/test_codegen.py index e88d6a37c291f..5073e5488b756 100644 --- a/tests/python/contrib/test_ethosu/test_codegen.py +++ b/tests/python/contrib/test_ethosu/test_codegen.py @@ -29,8 +29,8 @@ from tvm.relay.backend.contrib.ethosu import util from tests.python.relay.aot.aot_test_utils import generate_ref_data -import relay_ir_builder -import infra +from . import relay_ir_builder +from . import infra ACCEL_TYPES = ["ethos-u55-256", "ethos-u55-128", "ethos-u55-64", "ethos-u55-32"] diff --git a/tests/python/contrib/test_ethosu/test_encode_constants.py b/tests/python/contrib/test_ethosu/test_encode_constants.py index 0e546ae2fd24f..eb3a4d8cb4dad 100644 --- a/tests/python/contrib/test_ethosu/test_encode_constants.py +++ b/tests/python/contrib/test_ethosu/test_encode_constants.py @@ -26,7 +26,7 @@ from tvm.relay.backend.contrib.ethosu.tir.compiler import lower_to_tir from tvm.relay.backend.contrib.ethosu.tir.scheduler import Convolution2DCompute -from infra import make_ethosu_conv2d +from .infra import make_ethosu_conv2d # fmt: off diff --git a/tests/python/contrib/test_ethosu/test_legalize.py b/tests/python/contrib/test_ethosu/test_legalize.py index 52f6995c3aaa7..aad80ece97a82 100644 --- a/tests/python/contrib/test_ethosu/test_legalize.py +++ b/tests/python/contrib/test_ethosu/test_legalize.py @@ -27,7 +27,8 @@ from tvm.relay.backend.contrib.ethosu import legalize, preprocess from tvm.relay.dataflow_pattern import * from tvm.relay.op.contrib.ethosu import * -import relay_ir_builder + +from . import relay_ir_builder def test_split_indices_legalize(): diff --git a/tests/python/contrib/test_ethosu/test_networks.py b/tests/python/contrib/test_ethosu/test_networks.py index 76b8512d558d3..70ce9c551f2a6 100644 --- a/tests/python/contrib/test_ethosu/test_networks.py +++ b/tests/python/contrib/test_ethosu/test_networks.py @@ -31,7 +31,7 @@ from tvm.relay.backend.contrib.ethosu import util import tvm.relay.testing.tf as tf_testing -import infra +from . import infra ACCEL_TYPES = ["ethos-u55-256", "ethos-u55-128", "ethos-u55-64", "ethos-u55-32"] diff --git a/tests/python/contrib/test_ethosu/test_replace_conv2d.py b/tests/python/contrib/test_ethosu/test_replace_conv2d.py index 96fe56d1778ef..f66b21b92a03a 100644 --- a/tests/python/contrib/test_ethosu/test_replace_conv2d.py +++ b/tests/python/contrib/test_ethosu/test_replace_conv2d.py @@ -24,7 +24,7 @@ from tvm.relay.testing import run_opt_pass from tvm.relay.backend.contrib.ethosu.tir.compiler import lower_to_tir from tvm.relay.backend.contrib.ethosu.tir.scheduler import total_cascader -from infra import make_ethosu_conv2d, get_convolutional_args +from .infra import make_ethosu_conv2d, get_convolutional_args @pytest.mark.parametrize( diff --git a/tests/python/contrib/test_ethosu/test_replace_copy.py b/tests/python/contrib/test_ethosu/test_replace_copy.py index 222dccacc9062..2d76cd654690d 100644 --- a/tests/python/contrib/test_ethosu/test_replace_copy.py +++ b/tests/python/contrib/test_ethosu/test_replace_copy.py @@ -25,7 +25,7 @@ from tvm.relay.backend.contrib.ethosu.tir.compiler import lower_to_tir from tvm.relay.backend.contrib.ethosu.tir.scheduler import copy_constants -from infra import make_ethosu_conv2d +from .infra import make_ethosu_conv2d # fmt: off diff --git a/tests/python/contrib/test_ethosu/test_scheduler.py b/tests/python/contrib/test_ethosu/test_scheduler.py index b07f8ea7f48b2..8077271ed4964 100644 --- a/tests/python/contrib/test_ethosu/test_scheduler.py +++ b/tests/python/contrib/test_ethosu/test_scheduler.py @@ -29,7 +29,7 @@ schedule_cache_reads, ) from tvm.relay.backend.contrib.ethosu.tir.compiler import lower_to_te, extract_constants -from infra import AttachType, make_ethosu_conv2d +from .infra import AttachType, make_ethosu_conv2d class TestTEGraph: