mbs-octoml commented on a change in pull request #8597:
URL: https://github.com/apache/tvm/pull/8597#discussion_r683010154



##########
File path: src/ir/module.cc
##########
@@ -349,20 +349,23 @@ void IRModuleNode::Update(const IRModule& mod) {
 
 IRModule IRModule::FromExpr(const RelayExpr& expr,
                             const tvm::Map<GlobalVar, BaseFunc>& global_funcs,
-                            const tvm::Map<GlobalTypeVar, TypeData>& 
type_definitions) {
-  auto mod = IRModule(global_funcs, type_definitions);
+                            const tvm::Map<GlobalTypeVar, TypeData>& 
type_definitions,
+                            std::unordered_set<String> import_set, const 
std::string& name_hint) {
+  auto mod = IRModule(global_funcs, type_definitions, std::move(import_set));
   BaseFunc func;
-  std::string gv_name = "main";
+  std::string gv_name = name_hint;
 
   if (auto* func_node = expr.as<BaseFuncNode>()) {
     func = GetRef<BaseFunc>(func_node);
     if (auto opt = func->GetAttr<String>(tvm::attr::kGlobalSymbol)) {
       gv_name = opt.value();
     }
-
   } else {
     func = relay::Function(relay::FreeVars(expr), expr, Type(), 
relay::FreeTypeVars(expr, mod), {});
   }
+  if (gv_name.empty()) {

Review comment:
       Yeah, 'main' is endemic now. I got a bit of the way there addressing 
your FromExpr feedback above. Started to remove the dependence on 'main' but 
that got out of hand quickly so put it back in the bottle.




-- 
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]


Reply via email to