mbs-octoml commented on code in PR #11481:
URL: https://github.com/apache/tvm/pull/11481#discussion_r890548348


##########
src/relay/ir/dataflow_matcher_impl.h:
##########
@@ -39,10 +41,21 @@ namespace relay {
 
 class DFPatternMatcher : public DFPatternFunctor<bool(const DFPattern&, const 
Expr&)> {
  public:
-  explicit DFPatternMatcher(const Expr& root_expr) : 
expr_graph_(CreateIndexedGraph(root_expr)) {}
+  explicit DFPatternMatcher(const IndexedGraph<Expr>* expr_graph) : 
expr_graph_(expr_graph) {}
   bool Match(const DFPattern& pattern, const Expr& expr);
   Map<DFPattern, Array<Expr>> GetMemo() { return Map<DFPattern, 
Array<Expr>>(memo_); }
-  const IndexedGraph<Expr> expr_graph_;
+
+  const IndexedGraph<Expr>::Node* expr_to_node(const Expr& expr) const {
+    return expr_graph_->item_to_node(expr);
+  }
+  const IndexedGraph<Expr>::Node* index_to_node(size_t index) const {
+    return expr_graph_->index_to_node(index);
+  }
+  size_t size() const { return expr_graph_->size(); }
+  const std::unordered_map<DFPattern, Array<Expr>, ObjectPtrHash, 
ObjectPtrEqual>& memo() const {
+    return memo_;
+  }
+  const IndexedGraph<Expr>& dataflow_graph() const { return *expr_graph_; }

Review Comment:
   Agree. As we discussed offline I'll stick with 'Indexed graph' and not muddy 
the water since the other possibilities seem just as vague.



##########
src/relay/ir/expr.cc:
##########
@@ -27,6 +27,26 @@
 
 namespace tvm {
 
+GlobalVar WithFields(GlobalVar global_var, Optional<String> opt_name_hint, 
Optional<Type> opt_type,

Review Comment:
   roger, done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to