From cebcd293792d6a35691cb3a507940636f3607b48 Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Mon, 13 Sep 2021 17:52:20 -0700 Subject: [PATCH] fix crt test --- python/tvm/micro/build.py | 7 +++++-- tests/python/unittest/test_crt.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/python/tvm/micro/build.py b/python/tvm/micro/build.py index bef1e32fe07e7..44e44782d5b83 100644 --- a/python/tvm/micro/build.py +++ b/python/tvm/micro/build.py @@ -23,6 +23,7 @@ import pathlib import contextlib +from typing import Union from .._ffi import libinfo from .. import rpc as _rpc @@ -68,14 +69,16 @@ class AutoTvmModuleLoader: Parameters ---------- - template_project_dir : str + template_project_dir : Union[pathlib.Path, str] project template path project_options : dict project generation option """ - def __init__(self, template_project_dir: str, project_options: dict = None): + def __init__( + self, template_project_dir: Union[pathlib.Path, str], project_options: dict = None + ): self._project_options = project_options if isinstance(template_project_dir, pathlib.Path): diff --git a/tests/python/unittest/test_crt.py b/tests/python/unittest/test_crt.py index 989357a5589a5..af14a38c9f9ad 100644 --- a/tests/python/unittest/test_crt.py +++ b/tests/python/unittest/test_crt.py @@ -248,7 +248,7 @@ def test_autotune(): inputs = {"data": input_data} target = tvm.target.target.micro("host") - template_project_dir = os.path.join(tvm.micro.get_standalone_crt_dir(), "template", "host") + template_project_dir = pathlib.Path(tvm.micro.get_standalone_crt_dir()) / "template" / "host" pass_context = tvm.transform.PassContext(opt_level=3, config={"tir.disable_vectorize": True}) with pass_context: