mehrdadh commented on code in PR #11464:
URL: https://github.com/apache/tvm/pull/11464#discussion_r900379365
##########
tests/python/unittest/test_micro_model_library_format.py:
##########
@@ -95,8 +101,35 @@ def test_export_operator_model_library_format():
assert tir_f.read() == str(ir_mod)
[email protected]_micro
+def test_export_multiple_operator_model_library_format():
+ target = tvm.target.target.micro("host")
+ with tvm.transform.PassContext(opt_level=3,
config={"tir.disable_vectorize": True}):
+ A = tvm.te.placeholder((2,), dtype="int8")
+ B = tvm.te.placeholder((1,), dtype="int8")
+ C = tvm.te.compute(A.shape, lambda i: A[i] + B[0], name="C")
+ sched = tvm.te.create_schedule(C.op)
+ mod = tvm.build(
+ sched,
+ [A, B, C],
+ tvm.target.Target(target, target),
+ runtime=Runtime("crt", {"system-lib": True}),
+ name="add",
+ )
+
+ temp_dir = utils.tempdir()
+ mlf_tar_path = temp_dir.relpath("lib.tar")
+
+ with pytest.raises(RuntimeError) as exc:
+ micro.export_model_library_format([mod, mod], mlf_tar_path)
+
+ assert str(exc.exception) == ("Multiple operator is not supported.")
Review Comment:
sure, will do a follow up PR. thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]