diff --git a/python/tvm/micro/project.py b/python/tvm/micro/project.py index 8d1408c679fb..b1f2b49d972e 100644 --- a/python/tvm/micro/project.py +++ b/python/tvm/micro/project.py @@ -92,17 +92,16 @@ class TemplateProject: """Defines a glue interface to interact with a template project through the API Server.""" @classmethod - def from_directory(cls, template_project_dir, options): - return cls(client.instantiate_from_dir(template_project_dir), options) + def from_directory(cls, template_project_dir): + return cls(client.instantiate_from_dir(template_project_dir)) - def __init__(self, api_client, options): + def __init__(self, api_client): self._api_client = api_client - self._options = options self._info = self._api_client.server_info_query(__version__) if not self._info["is_template"]: raise NotATemplateProjectError() - def generate_project(self, graph_executor_factory, project_dir): + def generate_project(self, graph_executor_factory, project_dir, options): """Generate a project given GraphRuntimeFactory.""" model_library_dir = utils.tempdir() model_library_format_path = model_library_dir.relpath("model.tar") @@ -112,10 +111,13 @@ def generate_project(self, graph_executor_factory, project_dir): model_library_format_path=model_library_format_path, standalone_crt_dir=get_standalone_crt_dir(), project_dir=project_dir, - options=self._options, + options=options, ) - return GeneratedProject.from_directory(project_dir, self._options) + return GeneratedProject.from_directory(project_dir, options) + + def info(self): + return self._info def generate_project( @@ -147,5 +149,5 @@ def generate_project( GeneratedProject : A class that wraps the generated project and which can be used to further interact with it. """ - template = TemplateProject.from_directory(str(template_project_dir), options) - return template.generate_project(module, str(generated_project_dir)) + template = TemplateProject.from_directory(str(template_project_dir)) + return template.generate_project(module, str(generated_project_dir), options)