d-smirnov commented on a change in pull request #8509:
URL: https://github.com/apache/tvm/pull/8509#discussion_r803694200
##########
File path: src/printer/tvmscript_printer.cc
##########
@@ -349,6 +350,26 @@ class TVMScriptPrinter : public StmtFunctor<Doc(const
Stmt&)>,
}
};
+/*!
+ * \brief special method to print NDArray in TIR
+ * \param arr the NDArray to be printed
+ * \param os the output stream where the NDArray will be printed to
+ */
+template <typename T>
+void NDArrayToTIR(::tvm::runtime::NDArray arr, std::ostream& os) {
+ int ndim = arr->ndim;
+ int tot_dim = 1;
+ for (int i = 0; i < ndim; i++) {
+ tot_dim *= arr->shape[i];
+ }
+ T* data_ptr = reinterpret_cast<T*>(arr->data);
+ os << "[";
+ for (int i = 0; i < tot_dim; i++) {
+ os << data_ptr[i] << ", ";
Review comment:
Fixed
--
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]