From commits-return-11943-archive-asf-public=cust-asf.ponee.io@tvm.apache.org Wed Apr 22 20:24:54 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 0FADE180181 for ; Wed, 22 Apr 2020 22:24:53 +0200 (CEST) Received: (qmail 50067 invoked by uid 500); 22 Apr 2020 20:24:53 -0000 Mailing-List: contact commits-help@tvm.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tvm.apache.org Delivered-To: mailing list commits@tvm.apache.org Received: (qmail 50049 invoked by uid 99); 22 Apr 2020 20:24:53 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Apr 2020 20:24:53 +0000 From: =?utf-8?q?GitBox?= To: commits@tvm.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bincubator-tvm=5D_comaniac_commented_on_a_change_in?= =?utf-8?q?_pull_request_=235410=3A_=5BBYOC=5D_Use_Non-Recursive_Visitor/Mut?= =?utf-8?q?ator?= Message-ID: <158758709343.3807.5081676691397233569.asfpy@gitbox.apache.org> Date: Wed, 22 Apr 2020 20:24:53 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit References: In-Reply-To: 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(ExprMutator::VisitExpr_(cn)); + Call post_call = Downcast(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 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