zhiics commented on a change in pull request #6364:
URL: https://github.com/apache/incubator-tvm/pull/6364#discussion_r480285596



##########
File path: src/printer/relay_text_printer.cc
##########
@@ -330,6 +330,14 @@ Doc RelayTextPrinter::VisitExpr_(const ConstantNode* op) {
       return ScalarLiteral(dtype, static_cast<const 
uint8_t*>(op->data->data)[0]);
     }
   }
+  const PackedFunc* fprint = runtime::Registry::Get("relay._constant_text");

Review comment:
       Yeah, I am okay with this. I think another possible way could use a 
user-defined annotator and pass it to the pretty printer. One example could be 
something like:
   
   ```python
   def constant_annotator():
       def _annotate(e):
           if isinstance(e, relay.Constant):
               # Print the constant
           else:
               return ""
       return _annotate
   
   # Given an IRModule m or an expression m
   print(m.astext(show_meta_data=False, annotate=constant_annotator()))
   ```




----------------------------------------------------------------
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:
[email protected]


Reply via email to