You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/06/03 08:49:24 UTC

[GitHub] [tvm] leandron commented on a change in pull request #8176: [TVMC] Fix tvmc compile to extract target and target_host from --target

leandron commented on a change in pull request #8176:
URL: https://github.com/apache/tvm/pull/8176#discussion_r644609359



##########
File path: python/tvm/driver/tvmc/common.py
##########
@@ -295,10 +299,20 @@ def target_from_cli(target):
             raise TVMCException(f"Error parsing target string '{target}'.\nThe error was: {ex}")
 
         validate_targets(parsed_targets)
-        target = parsed_targets[-1]["raw"]
-        extra_targets = parsed_targets[:-1] if len(parsed_targets) > 1 else []
+        tvm_targets = [t for t in parsed_targets if t["is_tvm_target"]]
+
+        # Validated target strings have 1 or 2 tvm targets, otherwise
+        # `validate_targets` above will fail.
+        if len(tvm_targets) == 1:
+            target = tvm_targets[0]["raw"]
+            target_host = None
+        elif len(tvm_targets) == 2:

Review comment:
       Yeah, makes sense.




-- 
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:
users@infra.apache.org