junrushao1994 commented on a change in pull request #10578:
URL: https://github.com/apache/tvm/pull/10578#discussion_r826423513
##########
File path: python/tvm/meta_schedule/integration.py
##########
@@ -230,45 +213,32 @@ def extract_task_from_relay(
The tasks extracted from this network
"""
- @contextmanager
- def _autotvm_silencer():
- from tvm import autotvm # pylint: disable=import-outside-toplevel
-
- silent = autotvm.GLOBAL_SCOPE.silent
- autotvm.GLOBAL_SCOPE.silent = True
- try:
- yield
- finally:
- autotvm.GLOBAL_SCOPE.silent = silent
+ extract_task_func =
get_global_func("relay.backend.MetaScheduleExtractTask")
+ assert extract_task_func
- def _thread_run(func: Callable[[], None]) -> None:
- import threading # pylint: disable=import-outside-toplevel
+ target = Target(target) if isinstance(target, str) else target
- thread = threading.Thread(target=func)
- thread.start()
- thread.join()
+ relay_params = {}
+ for name, param in params.items():
+ if isinstance(param, np.ndarray):
+ param = nd.array(param)
+ relay_params[name] = const(param)
Review comment:
Would you mind elaborating why we need to convert NDArray to
relay::Constant? Thanks a lot!
--
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]