tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] comaniac commented on a change in pull request #5410: [BYOC] Use Non-Recursive Visitor/Mutator
Date Wed, 22 Apr 2020 20:24:53 GMT

comaniac commented on a change in pull request #5410:
URL: https://github.com/apache/incubator-tvm/pull/5410#discussion_r413304307



##########
File path: src/relay/transforms/annotate_target.cc
##########
@@ -181,50 +181,47 @@ class AnnotateTargetWrapper : public ExprMutator {
     std::string target = supported_targets[0];
 
     // Visit and mutate arguments after the target of this op has been determined.
-    auto new_call = Downcast<Call>(ExprMutator::VisitExpr_(cn));
+    Call post_call = Downcast<Call>(post);
 
     // Add annotations to each arg.
-    auto target_n_args = AnnotateArgs(new_call->args, target);
+    auto target_n_args = AnnotateArgs(post_call->args, target);
     Array<Expr> compiler_begins = std::get<1>(target_n_args);
-    Call call = Call(new_call->op, compiler_begins, new_call->attrs);
-    call->checked_type_ = cn->checked_type_;
+    Call new_call = Call(post_call->op, compiler_begins, post_call->attrs);
+    new_call->checked_type_ = pre->checked_type_;
 
     // Update the target map.
-    op_expr_to_target_[call] = target;
+    op_expr_to_target_[new_call] = target;
 
-    return std::move(call);
+    return new_call;

Review comment:
       Thanks for pointing out. I'll fix this along with other unit tests. Although it looks
weird to me, I don't think that's a bug in the MixedMode classes.




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



Mime
View raw message