From commits-return-11151-archive-asf-public=cust-asf.ponee.io@tvm.apache.org Sun Apr 12 00:20:05 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 410C0180181 for ; Sun, 12 Apr 2020 02:20:05 +0200 (CEST) Received: (qmail 69483 invoked by uid 500); 12 Apr 2020 00:20:04 -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 69462 invoked by uid 99); 12 Apr 2020 00:20:04 -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; Sun, 12 Apr 2020 00:20:04 +0000 From: GitBox To: commits@tvm.apache.org Subject: [GitHub] [incubator-tvm] masahi commented on a change in pull request #5310: [BYOC] Enhance partitioning and external codegen Message-ID: <158665080467.2216.16586982135887973580.gitbox@gitbox.apache.org> References: In-Reply-To: Date: Sun, 12 Apr 2020 00:20:04 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit masahi commented on a change in pull request #5310: [BYOC] Enhance partitioning and external codegen URL: https://github.com/apache/incubator-tvm/pull/5310#discussion_r407126346 ########## File path: src/relay/backend/contrib/dnnl/codegen.cc ########## @@ -128,42 +128,50 @@ std::vector Add(const CallNode* call) { // TODO(@zhiics, @comaniac): This is a basic implementation. We should implement // all utilities and make a base class for users to implement. -class CodegenDNNL : public ExprVisitor, public CodegenCBase { +class CodegenDNNL : public relay::ExprFunctor(const Expr&)>, + public CodegenCBase { public: explicit CodegenDNNL(const std::string& id) { this->ext_func_id_ = id; } - void VisitExpr_(const VarNode* node) final { + std::vector VisitExpr(const Expr& expr) final { + if (visited_.count(expr)) return visited_.at(expr); Review comment: hmm but it does have one dispatching function https://github.com/apache/incubator-tvm/blob/master/include/tvm/relay/expr_functor.h#L93 Why can't we have memoization there? If a derived class wants a custom memoization it can overide this method. ---------------------------------------------------------------- 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