Mousius commented on a change in pull request #8331:
URL: https://github.com/apache/tvm/pull/8331#discussion_r658727516
##########
File path: python/tvm/driver/tvmc/model.py
##########
@@ -332,8 +333,13 @@ def import_package(self, package_path: str):
# Model Library Format (MLF)
self.lib_name = None
self.lib_path = None
+ with open(temp.relpath("metadata.json")) as metadata_json:
+ metadata = json.load(metadata_json)
- graph = temp.relpath("runtime-config/graph/graph.json")
+ if "graph" in metadata["runtimes"]:
+ graph = temp.relpath("runtime-config/graph/graph.json")
+ else:
+ graph = None
Review comment:
I'll use the code as docs rather than a comment and pop the condition in
a variable:
```
is_graph_runtime = "graph" in metadata["runtimes"]
graph = temp.relpath("runtime-config/graph/graph.json") if is_graph_runtime
else None
```
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]