From dev-return-3194-archive-asf-public=cust-asf.ponee.io@singa.incubator.apache.org Thu Aug 8 02:57:27 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 8EF54180643 for ; Thu, 8 Aug 2019 04:57:27 +0200 (CEST) Received: (qmail 4553 invoked by uid 500); 8 Aug 2019 02:57:26 -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 4543 invoked by uid 99); 8 Aug 2019 02:57:26 -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; Thu, 08 Aug 2019 02:57:26 +0000 From: GitBox To: dev@singa.apache.org Subject: [GitHub] [incubator-singa] chrishkchris commented on a change in pull request #488: SINGA -475 add Sign operator to singa Message-ID: <156523304678.15493.9801295027328865196.gitbox@gitbox.apache.org> Date: Thu, 08 Aug 2019 02:57:26 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit chrishkchris commented on a change in pull request #488: SINGA -475 add Sign operator to singa URL: https://github.com/apache/incubator-singa/pull/488#discussion_r311838195 ########## File path: python/singa/autograd.py ########## @@ -1828,3 +1828,18 @@ def backward(self, dy): def leakyrelu(x, a=0.01): return LeakyRelu(a)(x)[0] + + +class Sign(Operation): + def forward(self, a): Review comment: Thanks for the modification. The below is the reason this is needed. This function passes the name "Sign" to the superclass (Operation) initializer. The superclass Operation initializer is as follows: ``` class Operation(object): op_count = 0 def __init__(self, name=None): if name is None: self.name = "{}#{}".format( self.__class__.__name__, Operation.op_count ) Operation.op_count += 1 else: self.name = name ``` If there is no initialzer in the subclass, the superclass initializer will be called with the "name=None" ---------------------------------------------------------------- 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