From dev-return-3246-archive-asf-public=cust-asf.ponee.io@singa.incubator.apache.org Fri Aug 9 10:28:58 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 1CFB218063F for ; Fri, 9 Aug 2019 12:28:58 +0200 (CEST) Received: (qmail 60152 invoked by uid 500); 9 Aug 2019 10:28:57 -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 60142 invoked by uid 99); 9 Aug 2019 10:28:57 -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:28:57 +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: <156534653734.3715.14696224729827997469.gitbox@gitbox.apache.org> Date: Fri, 09 Aug 2019 10:28:57 -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 why this is needed. This function passes the name "Sign" to the superclass (Operation) initializer. The superclass Operation initializer is as follows: ``` python 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 used instead 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