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

junrushao pushed a commit to branch feature/2023-01-24/migrate-parser
in repository https://gitbox.apache.org/repos/asf/tvm.git

commit 79aa6a71bc50d16c06581e11dc6b32773b072288
Author: Junru Shao <[email protected]>
AuthorDate: Tue Jan 24 11:38:14 2023 -0800

    ...
---
 include/tvm/relay/parser.h                          | 2 +-
 tests/cpp/relay/backend/aot/aot_lower_main_test.cc  | 4 ++--
 tests/cpp/relay/collage/candidate_partition_test.cc | 4 ++--
 tests/cpp/relay/collage/partition_rule_test.cc      | 2 +-
 tests/cpp/relay/df_pattern_rewrite_test.cc          | 4 ++--
 tests/cpp/relay/ir/indexed_graph_test.cc            | 6 +++---
 tests/cpp/relay/transforms/device_domains_test.cc   | 4 ++--
 tests/cpp/relay/with_fields_test.cc                 | 6 +++---
 8 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/include/tvm/relay/parser.h b/include/tvm/relay/parser.h
index 916e6b5c45..6e33e7873f 100644
--- a/include/tvm/relay/parser.h
+++ b/include/tvm/relay/parser.h
@@ -41,7 +41,7 @@ IRModule ParseModule(const std::string& file_name, const 
std::string& file_conte
  * for all Relay sub-expressions. This improves error and debugging 
diagnostics downstream for
  * modules constructed programaticaly rather than textually.
  */
-transform::Pass AnnotateSpans();
+tvm::transform::Pass AnnotateSpans();
 
 }  // namespace relay
 }  // namespace tvm
diff --git a/tests/cpp/relay/backend/aot/aot_lower_main_test.cc 
b/tests/cpp/relay/backend/aot/aot_lower_main_test.cc
index 31166f1e6b..0157f031c2 100644
--- a/tests/cpp/relay/backend/aot/aot_lower_main_test.cc
+++ b/tests/cpp/relay/backend/aot/aot_lower_main_test.cc
@@ -20,7 +20,7 @@
 #include "../../../../../src/relay/backend/aot/aot_lower_main.h"
 
 #include <gtest/gtest.h>
-#include <tvm/parser/parser.h>
+#include <tvm/relay/parser.h>
 
 namespace tvm {
 namespace relay {
@@ -37,7 +37,7 @@ TEST(AOTLowerMain, ExprAllocatorSkipNestedFunc) {
         %0(%x)
       }
     )";
-  IRModule mod = parser::ParseModule("string", mod_text, {}, {});
+  IRModule mod = ParseModule("string", mod_text, {}, {});
   auto host_target = tvm::Target("llvm");
   auto prim_target = tvm::Target(host_target, host_target);
   auto ctxt = tvm::transform::PassContext::Current();
diff --git a/tests/cpp/relay/collage/candidate_partition_test.cc 
b/tests/cpp/relay/collage/candidate_partition_test.cc
index bc5d2d880a..d298a493c1 100644
--- a/tests/cpp/relay/collage/candidate_partition_test.cc
+++ b/tests/cpp/relay/collage/candidate_partition_test.cc
@@ -20,9 +20,9 @@
 #include "../../../src/relay/collage/candidate_partition.h"
 
 #include <gtest/gtest.h>
-#include <tvm/parser/parser.h>
 #include <tvm/relay/expr.h>
 #include <tvm/relay/function.h>
+#include <tvm/relay/parser.h>
 #include <tvm/relay/transform.h>
 
 #include "../../../../src/relay/collage/mock_cost_estimator.h"
@@ -37,7 +37,7 @@ namespace {
 // so not re-tested here. The only other non-trivial code is 
CandidatePartition::EstimateCost
 
 Function MakeTestFunction(const std::string& mod_text) {
-  IRModule mod = parser::ParseModule("string", mod_text, {}, {});
+  IRModule mod = ParseModule("string", mod_text, {}, {});
   mod = transform::CapturePostDfsIndexInSpans()(mod);
   auto func = Downcast<Function>(mod->Lookup("main"));
   LOG(INFO) << "------- input function -------";
diff --git a/tests/cpp/relay/collage/partition_rule_test.cc 
b/tests/cpp/relay/collage/partition_rule_test.cc
index 51a4970c7e..60618e696a 100644
--- a/tests/cpp/relay/collage/partition_rule_test.cc
+++ b/tests/cpp/relay/collage/partition_rule_test.cc
@@ -20,9 +20,9 @@
 #include "../../../src/relay/collage/partition_rule.h"
 
 #include <gtest/gtest.h>
-#include <tvm/parser/parser.h>
 #include <tvm/relay/expr.h>
 #include <tvm/relay/function.h>
+#include <tvm/relay/parser.h>
 #include <tvm/relay/transform.h>
 
 #include "../../../src/relay/collage/partition_spec.h"
diff --git a/tests/cpp/relay/df_pattern_rewrite_test.cc 
b/tests/cpp/relay/df_pattern_rewrite_test.cc
index af09ae48aa..374887c12a 100644
--- a/tests/cpp/relay/df_pattern_rewrite_test.cc
+++ b/tests/cpp/relay/df_pattern_rewrite_test.cc
@@ -18,11 +18,11 @@
  */
 
 #include <gtest/gtest.h>
-#include <tvm/parser/parser.h>
 #include <tvm/relay/attrs/transform.h>
 #include <tvm/relay/dataflow_matcher.h>
 #include <tvm/relay/dataflow_pattern.h>
 #include <tvm/relay/function.h>
+#include <tvm/relay/parser.h>
 
 #include "../../../src/relay/transforms/simplify_expr.h"
 
@@ -82,7 +82,7 @@ TEST(DFPatternRewrite, DeeplyNestedWithCallAttributes) {
     }
   )";
 
-  IRModule module = parser::ParseModule("string", kModel);
+  IRModule module = ParseModule("string", kModel);
   DFPatternRewriteComposer composer;
   composer.AddRewrite<TestRewriter>();
   Function in_function = Downcast<Function>(module->Lookup("main"));
diff --git a/tests/cpp/relay/ir/indexed_graph_test.cc 
b/tests/cpp/relay/ir/indexed_graph_test.cc
index 17ec682616..486d027fbc 100644
--- a/tests/cpp/relay/ir/indexed_graph_test.cc
+++ b/tests/cpp/relay/ir/indexed_graph_test.cc
@@ -20,9 +20,9 @@
 #include "../../../src/relay/ir/indexed_graph.h"
 
 #include <gtest/gtest.h>
-#include <tvm/parser/parser.h>
 #include <tvm/relay/expr.h>
 #include <tvm/relay/function.h>
+#include <tvm/relay/parser.h>
 
 namespace tvm {
 namespace relay {
@@ -81,7 +81,7 @@ IRModule TestRecursiveIRModule() {
       (%19, %20)                                                         // 51
     }                                                                    // 52
   )";
-  return parser::ParseModule("string", kModel, /*init_module=*/{}, metadata);
+  return ParseModule("string", kModel, /*init_module=*/{}, metadata);
 }
 
 TEST(IndexedGraph, RecursiveExprRegression) {
@@ -179,7 +179,7 @@ IRModule TestUnusedLetBoundIRModule() {
       }
     }
   )";
-  return parser::ParseModule("string", kModel);
+  return ParseModule("string", kModel);
 }
 
 TEST(IndexedGraph, UnusedLetVars) {
diff --git a/tests/cpp/relay/transforms/device_domains_test.cc 
b/tests/cpp/relay/transforms/device_domains_test.cc
index c5b2f26315..47e303996b 100644
--- a/tests/cpp/relay/transforms/device_domains_test.cc
+++ b/tests/cpp/relay/transforms/device_domains_test.cc
@@ -27,7 +27,7 @@
 #include "../../../../src/relay/transforms/device_domains.h"
 
 #include <gtest/gtest.h>
-#include <tvm/parser/parser.h>
+#include <tvm/relay/parser.h>
 #include <tvm/relay/transform.h>
 
 namespace tvm {
@@ -36,7 +36,7 @@ namespace transform {
 namespace {
 
 IRModule TestModule() {
-  return InferType()(tvm::parser::ParseModule("test", R"(
+  return InferType()(ParseModule("test", R"(
     #[version = "0.0.5"]
     def @f(%x : Tensor[(3, 7), float32], %y : Tensor[(3, 7), float32]) {
       add(%x, %y)
diff --git a/tests/cpp/relay/with_fields_test.cc 
b/tests/cpp/relay/with_fields_test.cc
index 48e04c259b..6114fa97a9 100644
--- a/tests/cpp/relay/with_fields_test.cc
+++ b/tests/cpp/relay/with_fields_test.cc
@@ -23,18 +23,18 @@
  */
 
 #include <gtest/gtest.h>
-#include <tvm/parser/parser.h>
 #include <tvm/relay/adt.h>
 #include <tvm/relay/expr.h>
 #include <tvm/relay/function.h>
+#include <tvm/relay/parser.h>
 
 namespace tvm {
 namespace relay {
 namespace {
 
 IRModule TestIRModule() {
-  return parser::ParseModule("string",
-                             R"(
+  return ParseModule("string",
+                     R"(
     #[version = "0.0.5"]
     def @main(%data : Tensor[(1, 304, 128, 128), float32],
              %weight1 : Tensor[(304, 1, 3, 3), float32],

Reply via email to