junrushao1994 commented on a change in pull request #6315:
URL: https://github.com/apache/incubator-tvm/pull/6315#discussion_r474239482
##########
File path: python/tvm/target/target.py
##########
@@ -364,9 +394,11 @@ def create(target_str):
----
See the note on :py:mod:`tvm.target` on target string format.
"""
- if isinstance(target_str, Target):
+ if isinstance(target, Target):
return target_str
- if not isinstance(target_str, str):
- raise ValueError("target_str has to be string type")
+ if isinstance(target, dict):
+ return _ffi_api.TargetFromConfig(target)
+ if isinstance(target, str):
+ return _ffi_api.TargetFromString(target)
Review comment:
Yes, I think we should try to find a unified approach to create target
from
1) file
2) json string
3) json-like dict
4) legacy raw string
5) tag
----------------------------------------------------------------
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]