masahi commented on code in PR #13135:
URL: https://github.com/apache/tvm/pull/13135#discussion_r999259118


##########
src/printer/tvmscript_printer.cc:
##########
@@ -457,6 +457,12 @@ class TVMScriptPrinter : public StmtFunctor<Doc(const 
Stmt&)>,
  */
 template <typename T>
 void NDArrayToTIR(::tvm::runtime::NDArray arr, std::ostream& os) {
+  if (arr.DataType().code() == runtime::DataType::kInt ||
+      arr.DataType().code() == runtime::DataType::kUInt) {
+    // Printing integer NDArrays causes "UnicodeDecodeError: 'utf-8' codec 
can't decode byte"
+    // error during MetaSchedule tuning on int8 models.
+    return;
+  }

Review Comment:
   We can't print an entire constant tensor to text, so this function is broken 
anyway in practice. I've update one of TVMScript parsing tests to avoid 
printing integer constants. 



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