Skip to content

Commit

Permalink
ffix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mehrdadh committed Sep 17, 2021
1 parent 96362c1 commit bb1d39a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions python/tvm/micro/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,19 @@ def __init__(self, api_client):
def _check_project_options(self, options: dict):
"""Check if options are valid ProjectOptions"""
valid_project_options = [item["name"] for item in self.info()["project_options"]]
valid = True

if not all(element in list(valid_project_options) for element in list(options)):
if options is not None:
if valid_project_options is None:
valie = False
else:
if not all(element in list(valid_project_options) for element in list(options)):
valid = False

if not valid:
raise ValueError(
f"""options:{list(options)} include none valid ProjectOptions.
Here is a list of valid options:{list(valid_project_options)}."""
Here is a list of valid options:{list(valid_project_options)}."""
)

def generate_project_from_mlf(self, model_library_format_path, project_dir, options):
Expand Down

0 comments on commit bb1d39a

Please sign in to comment.