You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/04/09 21:31:24 UTC

[GitHub] [incubator-tvm] masahi commented on a change in pull request #5296: Legalize - Use Non-recursive Rewriter.

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:
users@infra.apache.org


With regards,
Apache Git Services