You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/08/20 03:39:46 UTC

[GitHub] [tvm] ganler commented on a diff in pull request #12507: [TIR][Schedule][UX] Beautify TIR Trace Printing

ganler commented on code in PR #12507:
URL: https://github.com/apache/tvm/pull/12507#discussion_r950643008


##########
src/tir/schedule/trace.cc:
##########
@@ -476,6 +476,8 @@ TVM_STATIC_IR_FUNCTOR(ReprPrinter, vtable)
     .set_dispatch<TraceNode>([](const ObjectRef& obj, ReprPrinter* p) {
       const auto* self = obj.as<TraceNode>();
       ICHECK_NOTNULL(self);
+      p->stream << "# from tvm import tir" << std::endl;
+      p->stream << "def apply_trace(sch: tir.Schedule) -> None:" << std::endl;

Review Comment:
   Just a minor suggestion that frequently calling IO flushing via `std::endl` for shorter strings might be slow. So putting a `std::flush` in the end and keep using `<< '\n'` for newlines other than `<< std::endl` in previous places is usually more efficient.



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org