From 154a905881cc5adde80a6ad27d2a8f9a9b53ed4f Mon Sep 17 00:00:00 2001 From: Jared Roesch Date: Mon, 4 Feb 2019 18:02:21 -0800 Subject: [PATCH 1/5] Support VMObject in visit API --- src/tvm/node/node.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tvm/node/node.h b/src/tvm/node/node.h index 89b5df8..d6815a5 100644 --- a/src/tvm/node/node.h +++ b/src/tvm/node/node.h @@ -23,6 +23,12 @@ namespace runtime { class NDArray; } // namespace runtime +namespace relay { +namespace vm { +struct VMObject; +} +} + /*! * \brief Visitor class to each node content. * The content is going to be called for each field. @@ -41,6 +47,7 @@ class EXPORT AttrVisitor { virtual void Visit(const char* key, Type* value) = 0; virtual void Visit(const char* key, NodeRef* value) = 0; virtual void Visit(const char* key, runtime::NDArray* value) = 0; + virtual void Visit(const char* key, relay::vm::VMObject* value) = 0; template::value>::type> void Visit(const char* key, ENum* ptr) { From cddd070c969485ed76a3ceebdb8e4541b6354267 Mon Sep 17 00:00:00 2001 From: Jared Roesch Date: Mon, 25 Mar 2019 23:04:45 -0700 Subject: [PATCH 2/5] Rename VMObject --- src/tvm/node/node.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/tvm/node/node.h b/src/tvm/node/node.h index d6815a5..110e060 100644 --- a/src/tvm/node/node.h +++ b/src/tvm/node/node.h @@ -23,11 +23,10 @@ namespace runtime { class NDArray; } // namespace runtime -namespace relay { namespace vm { -struct VMObject; -} -} +// forward declaration +struct Object; +} // namespace runtime /*! * \brief Visitor class to each node content. From efb14e394223350e670be3104deed4be553cf4e2 Mon Sep 17 00:00:00 2001 From: Jared Roesch Date: Mon, 25 Mar 2019 23:23:05 -0700 Subject: [PATCH 3/5] Fix header --- src/tvm/node/node.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tvm/node/node.h b/src/tvm/node/node.h index 110e060..e41da9c 100644 --- a/src/tvm/node/node.h +++ b/src/tvm/node/node.h @@ -46,7 +46,7 @@ class EXPORT AttrVisitor { virtual void Visit(const char* key, Type* value) = 0; virtual void Visit(const char* key, NodeRef* value) = 0; virtual void Visit(const char* key, runtime::NDArray* value) = 0; - virtual void Visit(const char* key, relay::vm::VMObject* value) = 0; + virtual void Visit(const char* key, runtime::vm::Object* value) = 0; template::value>::type> void Visit(const char* key, ENum* ptr) { From b133e55db025c962e30b045a6a3b937e9c03ca14 Mon Sep 17 00:00:00 2001 From: Jared Roesch Date: Mon, 25 Mar 2019 23:31:23 -0700 Subject: [PATCH 4/5] Move into runtime namespace --- src/tvm/node/node.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/tvm/node/node.h b/src/tvm/node/node.h index e41da9c..0df7b4d 100644 --- a/src/tvm/node/node.h +++ b/src/tvm/node/node.h @@ -21,9 +21,6 @@ class NodeRef; namespace runtime { // forward declaration class NDArray; -} // namespace runtime - -namespace vm { // forward declaration struct Object; } // namespace runtime @@ -46,7 +43,7 @@ class EXPORT AttrVisitor { virtual void Visit(const char* key, Type* value) = 0; virtual void Visit(const char* key, NodeRef* value) = 0; virtual void Visit(const char* key, runtime::NDArray* value) = 0; - virtual void Visit(const char* key, runtime::vm::Object* value) = 0; + virtual void Visit(const char* key, runtime::Object* value) = 0; template::value>::type> void Visit(const char* key, ENum* ptr) { From cea4958f3223e6c14e9058eea85b6fa4ef9c4009 Mon Sep 17 00:00:00 2001 From: Jared Roesch Date: Mon, 25 Mar 2019 23:55:17 -0700 Subject: [PATCH 5/5] Use class --- src/tvm/node/node.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tvm/node/node.h b/src/tvm/node/node.h index 0df7b4d..c7b24e3 100644 --- a/src/tvm/node/node.h +++ b/src/tvm/node/node.h @@ -22,7 +22,7 @@ namespace runtime { // forward declaration class NDArray; // forward declaration -struct Object; +class Object; } // namespace runtime /*!