zxybazh commented on a change in pull request #9497:
URL: https://github.com/apache/tvm/pull/9497#discussion_r748551678
##########
File path: python/tvm/relay/build_module.py
##########
@@ -332,16 +337,23 @@ def build(ir_mod, target=None, target_host=None,
params=None, mod_name="default"
"instead of deprecated parameter mod
(tvm.relay.function.Function)",
DeprecationWarning,
)
+
+ if target_host is not None:
+ warnings.warn(
+ "target_host parameter is going to be deprecated. "
+ "Please pass in tvm.target.Target(target, host=target_host)
instead."
+ )
+
+ target, target_host = Target.check_and_update_host_consist(
+ target, target_host, target_is_dict_key=False
+ )
+
target = build_target_by_device_type_map(target)
if isinstance(target_host, (str, Target)):
target_host = Target(target_host)
elif target_host:
raise ValueError("target host must be the type of str, " +
"tvm.target.Target, or None")
Review comment:
The type is already checked when doing `check_and_update_host_consist`
when it calls `target = Target(target, host)`, see
[here](https://github.com/apache/tvm/blob/be03d62e5b0afd607964365bc73e94f72fdfaaef/python/tvm/target/target.py#L108).
I'll remove it and check if there are other obsolete parts in my follow up PR.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]