[Debug] Add Dump function for Object type (NFC) (#5207)
authorWei Pan <60017475+wpan11nv@users.noreply.github.com>
Thu, 2 Apr 2020 02:44:52 +0000 (19:44 -0700)
committerGitHub <noreply@github.com>
Thu, 2 Apr 2020 02:44:52 +0000 (19:44 -0700)
Signed-off-by: Wei Pan <weip@nvidia.com>
include/tvm/node/repr_printer.h
src/node/repr_printer.cc

index 41789a3..5782430 100644 (file)
@@ -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
 
index e81a824..bf41c82 100644 (file)
@@ -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;