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


##########
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:
   Not fond of having this magic number, but it was the only way I could figure 
out to check that the function is at the top level of a module. Possibly a 
hack--is there a better way I could check for that?



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