This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git


The following commit(s) were added to refs/heads/master by this push:
     new 15b1751  [Debug] Add Dump function for Object type (NFC) (#5207)
15b1751 is described below

commit 15b1751c06b29862d5a665d89c6a11c829d5bcfe
Author: Wei Pan <[email protected]>
AuthorDate: Wed Apr 1 19:44:52 2020 -0700

    [Debug] Add Dump function for Object type (NFC) (#5207)
    
    Signed-off-by: Wei Pan <[email protected]>
---
 include/tvm/node/repr_printer.h | 8 +++++++-
 src/node/repr_printer.cc        | 6 +++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/include/tvm/node/repr_printer.h b/include/tvm/node/repr_printer.h
index 41789a3..5782430 100644
--- a/include/tvm/node/repr_printer.h
+++ b/include/tvm/node/repr_printer.h
@@ -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
 
diff --git a/src/node/repr_printer.cc b/src/node/repr_printer.cc
index e81a824..bf41c82 100644
--- a/src/node/repr_printer.cc
+++ b/src/node/repr_printer.cc
@@ -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;

Reply via email to