Commit 0565fcc8 by Yang Chen Committed by Tianqi Chen

Added a helper function that dumps Node to stderr (#1703)

parent 8e7ff260
...@@ -230,6 +230,13 @@ using Domain = Array<Range>; ...@@ -230,6 +230,13 @@ using Domain = Array<Range>;
// print functions for expr // print functions for expr
TVM_DLL std::ostream& operator<<(std::ostream& os, const NodeRef& n); // NOLINT(*) TVM_DLL std::ostream& operator<<(std::ostream& os, const NodeRef& n); // NOLINT(*)
/*!
* \brief Dump the node to stderr, used for debug purposes.
* \param node The input node
*/
TVM_DLL void Dump(const NodeRef& node);
// definition of Node. // definition of Node.
/*! /*!
* \brief An iteration variable representing an iteration * \brief An iteration variable representing an iteration
......
...@@ -47,6 +47,10 @@ std::ostream& operator<<(std::ostream& os, const NodeRef& n) { // NOLINT(*) ...@@ -47,6 +47,10 @@ std::ostream& operator<<(std::ostream& os, const NodeRef& n) { // NOLINT(*)
return os; return os;
} }
void Dump(const NodeRef& n) {
std::cerr << n << "\n";
}
Var var(const std::string& name_hint, Type t) { Var var(const std::string& name_hint, Type t) {
return Var(name_hint, t); return Var(name_hint, t);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment