Skip to content

Commit

Permalink
fix crt test
Browse files Browse the repository at this point in the history
  • Loading branch information
mehrdadh committed Sep 14, 2021
1 parent f95c459 commit 06d7331
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions python/tvm/micro/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import pathlib
import contextlib

from typing import Union
from .._ffi import libinfo
from .. import rpc as _rpc

Expand Down Expand Up @@ -68,17 +69,19 @@ 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):
if isinstance(template_project_dir, (pathlib.Path, str)):
self._template_project_dir = str(template_project_dir)
elif not isinstance(template_project_dir, str):
raise TypeError(f"Incorrect type {type(template_project_dir)}.")
Expand Down
2 changes: 1 addition & 1 deletion tests/python/unittest/test_crt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 06d7331

Please sign in to comment.