From commits-return-16657-archive-asf-public=cust-asf.ponee.io@tvm.apache.org Tue Jun 30 10:00:52 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 1C2B3180643 for ; Tue, 30 Jun 2020 12:00:52 +0200 (CEST) Received: (qmail 47291 invoked by uid 500); 30 Jun 2020 10:00:51 -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 47281 invoked by uid 99); 30 Jun 2020 10:00:51 -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; Tue, 30 Jun 2020 10:00:51 +0000 From: =?utf-8?q?GitBox?= To: commits@tvm.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bincubator-tvm=5D_masahi_commented_on_a_change_in_p?= =?utf-8?q?ull_request_=235919=3A_=5BBYOC=5D_JSON_Runtime_with_DNNL_End-to-E?= =?utf-8?q?nd_Flow?= Message-ID: <159351125140.8807.5102856741756722271.asfpy@gitbox.apache.org> Date: Tue, 30 Jun 2020 10:00:51 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In-Reply-To: References: masahi commented on a change in pull request #5919: URL: https://github.com/apache/incubator-tvm/pull/5919#discussion_r447564786 ########## File path: src/relay/backend/contrib/dnnl/codegen.cc ########## @@ -417,13 +424,87 @@ class DNNLModuleCodegen : public CSourceModuleCodegenBase { std::ostringstream code_stream_; }; +#else // DNNL JSON runtime + +class DNNLJSONSerializer : public backend::contrib::JSONSerializer { + using JSONGraphNode = tvm::runtime::json::JSONGraphNode; + using JSONGraphNodeEntry = tvm::runtime::json::JSONGraphNodeEntry; + + public: + DNNLJSONSerializer(const std::string& symbol, const Expr& expr) : JSONSerializer(symbol, expr) {} + + std::vector VisitExpr_(const CallNode* cn) override { + Expr expr = GetRef(cn); + std::string name; + const CallNode* call = cn; + if (const auto* op_node = cn->op.as()) { + name = op_node->name; + } else if (const auto* fn = cn->op.as()) { + auto comp = fn->GetAttr(attr::kComposite); + CHECK(comp.defined()) << "DNNL JSON runtime only supports composite functions."; + name = comp.value().operator std::string(); Review comment: remove `operator std::string()` ---------------------------------------------------------------- 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