singa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-singa] chrishkchris commented on a change in pull request #488: SINGA -475 add Sign operator to singa
Date Thu, 08 Aug 2019 02:56:02 GMT
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 autograd.py this is needed.
   
   This function passes the name "Sign" to the superclass (Operation) initializer.
   The superclass Operation initialize 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

Mime
View raw message