slyubomirsky commented on code in PR #15140:
URL: https://github.com/apache/tvm/pull/15140#discussion_r1238890248


##########
src/script/printer/relax/function.cc:
##########
@@ -52,17 +52,45 @@ TVM_STATIC_IR_FUNCTOR(IRDocsifier, vtable)
       (*f)->func_vars = nullptr;
       // Step 4. Print attributes
       if (n->attrs.defined() && !n->attrs->dict.empty()) {
-        (*f)->stmts.push_back(
-            ExprStmtDoc(Relax(d, "func_attr")  //
-                            ->Call({d->AsDoc<ExprDoc>(n->attrs, 
n_p->Attr("attrs"))})));
+        // if the function is a global function and has a global symbol,
+        // then don't print the global symbol (it will be implicit from not 
being private)
+        if (d->frames.size() == 3 && n->attrs->dict.count("global_symbol")) {

Review Comment:
   @yongwww might there be a more robust way to check if we're inside a module?



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