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


##########
src/script/printer/relax/utils.h:
##########
@@ -82,10 +84,47 @@ inline Optional<ExprDoc> StructInfoAsAnn(const relax::Var& 
v, const ObjectPath&
   if (!v->struct_info_.defined()) {
     return NullOpt;
   }
+  bool attempt_to_hide_struct_info = !d->cfg->show_all_struct_info;
+
   if (const auto* call = rhs.as<relax::CallNode>()) {
     static const Op& call_tir_op = Op::Get("relax.call_tir");
     static const Op& call_dps_packed_op = Op::Get("relax.call_dps_packed");
     if (call->op.same_as(call_tir_op) || call->op.same_as(call_dps_packed_op)) 
{
+      attempt_to_hide_struct_info = true;
+    }
+  }
+  if (attempt_to_hide_struct_info) {

Review Comment:
   Hm, I wonder if this is more complicated than what we would really want. 
Perhaps a syntactic rule for when to write StructInfo might make more sense? 
E.g., have it for op calls but not tuple indices, etc.? I'm not sure what 
situations are sufficiently non-obvious to require an annotation if a user 
wants to hide them. It's not wrong, but it seems a little unusual for the 
TVMScript printer to be running type inference itself.



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