You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/02/11 04:43:13 UTC

[GitHub] [incubator-tvm] FrozenGene commented on a change in pull request #4847: Use dummy func when no lowered_funcs exists in Relay mod

FrozenGene commented on a change in pull request #4847: Use dummy func when no lowered_funcs exists in Relay mod
URL: https://github.com/apache/incubator-tvm/pull/4847#discussion_r377444157
 
 

 ##########
 File path: src/relay/backend/build_module.cc
 ##########
 @@ -438,13 +442,19 @@ class RelayBuildModule : public runtime::ModuleNode {
 
     auto lowered_funcs = graph_codegen_->GetLoweredFunc();
     if (lowered_funcs.size() == 0) {
-      LOG(WARNING) << "no lowered funcs exist in the compiled module";
-    } else {
-      ret_.mod = tvm::build(
-        lowered_funcs,
-        target_host_,
-        BuildConfig::Current());
+      LOG(WARNING) << "No lowered funcs exist in the compiled module, "
+                   << "a dummy function \"__dummy__\" will be created.";
+      Stmt body = EvaluateNode::make(0);
+      Array<ObjectRef> api_args;
+      auto dummy_func = MakeAPI(body, "__dummy__", api_args, 0, false);
+      lowered_funcs.Set("llvm", Array<LoweredFunc>({dummy_func}));
 
 Review comment:
   I think should set `target_host_`. Even we have LLVM support, it is not correct too, imagine our target host is ARM.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services