ekalda commented on a change in pull request #8843:
URL: https://github.com/apache/tvm/pull/8843#discussion_r696504282



##########
File path: src/relay/transforms/simplify_expr.h
##########
@@ -54,14 +54,16 @@ class DFPatternRewrite {
       Map<DFPattern, Array<Expr>> node_map = args[2];
       *rv = this->Callback(pre, post, node_map);
     };
-    return DFPatternCallback(pattern_, PackedFunc(func), require_type_);
+    return DFPatternCallback(pattern_, PackedFunc(func), require_type_, 
rewrite_once_);
   }
 
  protected:
   /*! \brief The pattern for matching and rewriting. */
   DFPattern pattern_;
   /*! \brief Whether or not the rewrite requires types to be inferred. */
   bool require_type_ = true;
+  /*! \brief If True, rewrite only once. */
+  bool rewrite_once_ = false;

Review comment:
       Yes we don't need it, removed it

##########
File path: tests/python/relay/test_dataflow_pattern.py
##########
@@ -1793,3 +1825,4 @@ def test_partition_constant_embedding():
     test_IfPattern()
     test_match_if()
     test_no_match_if()
+    test_rewrite_once()

Review comment:
       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