masahi commented on a change in pull request #5296: Legalize - Use 
Non-recursive Rewriter.
URL: https://github.com/apache/incubator-tvm/pull/5296#discussion_r406489234
 
 

 ##########
 File path: src/relay/transforms/legalize.cc
 ##########
 @@ -35,14 +35,14 @@ namespace legalize {
 
 // Call registered FTVMLegalize of an op
 // Returns the legalized expression
-class Legalizer : public ExprMutator {
+class Legalizer : public ExprRewriter {
  public:
   explicit Legalizer(const std::string& legalize_map_attr_name)
       : legalize_map_attr_name_{legalize_map_attr_name} {}
 
-  Expr VisitExpr_(const CallNode* call_node) {
+  Expr Rewrite_(const CallNode* call_node, const Expr& post) override {
     // Get the new_call node without any changes to current call node.
-    Expr new_e = ExprMutator::VisitExpr_(call_node);
+    Expr new_e = post;
 
 Review comment:
   Can we just rename `post` to `new_e` and remove this line?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to