This is an automated email from the ASF dual-hosted git repository.
leandron pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 1d08792 [microTVM] Fix warnings on Zephyr tests (#8740)
1d08792 is described below
commit 1d087920a0f1a9ea065c2c7992a15235170f5c75
Author: Gustavo Romero <[email protected]>
AuthorDate: Mon Aug 16 05:09:01 2021 -0300
[microTVM] Fix warnings on Zephyr tests (#8740)
Fix the following warning message on Zephyr tests:
DeprecationWarning: Please use input parameter mod (tvm.IRModule)
instead of deprecated parameter mod (tvm.relay.function.Function)
Signd-off-by: Gustavo Romero <[email protected]>
---
tests/micro/zephyr/test_zephyr.py | 3 ++-
tests/micro/zephyr/test_zephyr_aot.py | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/micro/zephyr/test_zephyr.py
b/tests/micro/zephyr/test_zephyr.py
index 14e250c..d33033d 100644
--- a/tests/micro/zephyr/test_zephyr.py
+++ b/tests/micro/zephyr/test_zephyr.py
@@ -205,10 +205,11 @@ def test_relay(temp_dir, platform, west_cmd, tvm_debug):
xx = relay.multiply(x, x)
z = relay.add(xx, relay.const(np.ones(shape=shape, dtype=dtype)))
func = relay.Function([x], z)
+ ir_mod = tvm.IRModule.from_expr(func)
target = tvm.target.target.micro(model)
with tvm.transform.PassContext(opt_level=3,
config={"tir.disable_vectorize": True}):
- mod = tvm.relay.build(func, target=target)
+ mod = tvm.relay.build(ir_mod, target=target)
with _make_session(temp_dir, zephyr_board, west_cmd, mod, build_config) as
session:
graph_mod = tvm.micro.create_local_graph_executor(
diff --git a/tests/micro/zephyr/test_zephyr_aot.py
b/tests/micro/zephyr/test_zephyr_aot.py
index e143515..1022a50 100644
--- a/tests/micro/zephyr/test_zephyr_aot.py
+++ b/tests/micro/zephyr/test_zephyr_aot.py
@@ -233,10 +233,11 @@ def test_qemu_make_fail(temp_dir, platform, west_cmd,
tvm_debug):
xx = relay.multiply(x, x)
z = relay.add(xx, relay.const(np.ones(shape=shape, dtype=dtype)))
func = relay.Function([x], z)
+ ir_mod = tvm.IRModule.from_expr(func)
target = tvm.target.target.micro(model, options=["-link-params=1",
"--executor=aot"])
with tvm.transform.PassContext(opt_level=3,
config={"tir.disable_vectorize": True}):
- lowered = relay.build(func, target)
+ lowered = relay.build(ir_mod, target)
# Generate input/output header files
with tempfile.NamedTemporaryFile() as tar_temp_file: