Unverified Commit 15b1751c by Wei Pan Committed by GitHub

[Debug] Add Dump function for Object type (NFC) (#5207)

Signed-off-by: Wei Pan <weip@nvidia.com>
parent 5b857d3c
......@@ -51,7 +51,13 @@ class ReprPrinter {
* \brief Dump the node to stderr, used for debug purposes.
* \param node The input node
*/
TVM_DLL void Dump(const ObjectRef& node);
TVM_DLL void Dump(const runtime::ObjectRef& node);
/*!
* \brief Dump the node to stderr, used for debug purposes.
* \param node The input node
*/
TVM_DLL void Dump(const runtime::Object* node);
} // namespace tvm
......
......@@ -51,10 +51,14 @@ ReprPrinter::FType& ReprPrinter::vtable() {
return inst;
}
void Dump(const ObjectRef& n) {
void Dump(const runtime::ObjectRef& n) {
std::cerr << n << "\n";
}
void Dump(const runtime::Object* n) {
Dump(runtime::GetRef<runtime::ObjectRef>(n));
}
TVM_REGISTER_GLOBAL("node.AsRepr")
.set_body_typed([](runtime::ObjectRef obj) {
std::ostringstream os;
......
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