tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] anijain2305 commented on a change in pull request #5296: Legalize - Use Non-recursive Rewriter.
Date Thu, 09 Apr 2020 22:15:14 GMT
anijain2305 commented on a change in pull request #5296: Legalize - Use Non-recursive Rewriter.
URL: https://github.com/apache/incubator-tvm/pull/5296#discussion_r406507469
 
 

 ##########
 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:
   I could not directly rename, as `new_e` was supposed to be the new expr and `post` is a
cont. But, I have cleaned up the code, so that `new_e` is not needed anymore.

----------------------------------------------------------------
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

Mime
View raw message