Icemist commented on code in PR #13349:
URL: https://github.com/apache/tvm/pull/13349#discussion_r1030590633
##########
python/tvm/driver/build_module.py:
##########
@@ -221,29 +221,30 @@ def build(
----
See the note on :any:`tvm.target` on target string format.
"""
- if isinstance(inputs, te.Schedule):
- if args is None:
- raise ValueError("args must be given for build from schedule")
- input_mod = lower(inputs, args, name=name, binds=binds)
- elif isinstance(inputs, (list, tuple, container.Array)):
- merged_mod = tvm.IRModule({})
- for x in inputs:
- merged_mod.update(lower(x))
- input_mod = merged_mod
- elif isinstance(inputs, PrimFunc):
- input_mod = lower(inputs, name=name)
- elif isinstance(inputs, tvm.IRModule):
- input_mod = lower(inputs)
- elif not isinstance(inputs, (dict, container.Map)):
- raise ValueError(
- f"Inputs must be te.Schedule, IRModule, PrimFunc, "
- f"or dict of target to IRModule, "
- f"but got {type(inputs)}."
- )
+ target = Target.current() if target is None else target
+ target = target if target else "llvm"
+ with target:
Review Comment:
It was necessary to use with statement to be able to get the target object
using Target::current().
Now I have changed this by passing the target as an optional parameter for
lower function.
--
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]