From dev-return-3245-archive-asf-public=cust-asf.ponee.io@singa.incubator.apache.org Fri Aug 9 10:27:48 2019 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 CE80B18063F for ; Fri, 9 Aug 2019 12:27:47 +0200 (CEST) Received: (qmail 58826 invoked by uid 500); 9 Aug 2019 10:27:47 -0000 Mailing-List: contact dev-help@singa.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@singa.incubator.apache.org Delivered-To: mailing list dev@singa.incubator.apache.org Received: (qmail 58816 invoked by uid 99); 9 Aug 2019 10:27:47 -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; Fri, 09 Aug 2019 10:27:47 +0000 From: GitBox To: dev@singa.apache.org Subject: [GitHub] [incubator-singa] chrishkchris edited a comment on issue #488: SINGA -475 add Sign operator to singa Message-ID: <156534646714.3060.17239752590643233398.gitbox@gitbox.apache.org> Date: Fri, 09 Aug 2019 10:27:47 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit chrishkchris edited a comment on issue #488: SINGA -475 add Sign operator to singa URL: https://github.com/apache/incubator-singa/pull/488#issuecomment-519866518 This is what tensorflow uses: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/cc/gradients/math_grad.cc#L268 ```cpp Status SignGrad(const Scope& scope, const Operation& op, const std::vector& grad_inputs, std::vector* grad_outputs) { auto shape = Shape(scope, op.input(0)); auto zero = Cast(scope, Const(scope, 0.0), op.input(0).type()); auto dx = Fill(scope, shape, zero); grad_outputs->push_back(dx); return scope.status(); } REGISTER_GRADIENT_OP("Sign", SignGrad); ``` seems to fill the dx with all zero using the dy shape ---------------------------------------------------------------- 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