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/11/18 21:03:33 UTC

[GitHub] [tvm] shingjan commented on a diff in pull request #13433: [TVMScript] Output elif where possible

shingjan commented on code in PR #13433:
URL: https://github.com/apache/tvm/pull/13433#discussion_r1026879009


##########
src/printer/tvmscript_printer.cc:
##########
@@ -1259,10 +1259,22 @@ Doc TVMScriptPrinter::VisitStmt_(const IfThenElseNode* op) {
   Doc doc;
   doc << "if " << Print(op->condition) << ":";
   doc << Doc::Indent(4, Doc::NewLine() << PrintBody(op->then_case));
-  if (!is_one(op->condition) && op->else_case) {
-    doc << Doc::NewLine();
-    doc << "else:" << Doc::Indent(4, Doc::NewLine() << PrintBody(op->else_case.value()));
+
+  Optional<Stmt> else_case = op->else_case;

Review Comment:
   would that be possible that we can add a comment here or a code snippet in the PR to show the elif print before and after this change. Otherwise LGTM. 



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