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



##########
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:
       I know there already has a checker before invoking this function, but it 
would be better to use assert to make our purpose clear.
   ```suggestion
           else:
             assert len(tvm_targets) == 2
   ```




-- 
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]


Reply via email to