masahi commented on code in PR #14344:
URL: https://github.com/apache/tvm/pull/14344#discussion_r1142715542
##########
src/relay/ir/dataflow_matcher.cc:
##########
@@ -796,24 +796,38 @@ Expr PatternRewriter::Rewrite(const
Array<DFPatternCallback>& callbacks, const E
bool equal = true;
static auto* structural_equal =
runtime::Registry::Get("node.StructuralEqual");
ICHECK(structural_equal) << "node.StructuralEqual is not registered.";
+ // Use the callback until the callback's attribute is rewrite_once=true and
has been rewritten
Review Comment:
// Keep track of callbacks that have finished rewriting
##########
src/relay/ir/dataflow_matcher.cc:
##########
@@ -796,24 +796,38 @@ Expr PatternRewriter::Rewrite(const
Array<DFPatternCallback>& callbacks, const E
bool equal = true;
static auto* structural_equal =
runtime::Registry::Get("node.StructuralEqual");
ICHECK(structural_equal) << "node.StructuralEqual is not registered.";
+ // Use the callback until the callback's attribute is rewrite_once=true and
has been rewritten
+ std::unordered_map<DFPatternCallback, bool, ObjectPtrHash, ObjectPtrEqual>
callbacks_map;
Review Comment:
`callbacks_map` -> `done`, swapping false and true
--
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]