joddiy commented on a change in pull request #645: add function comments for
autograd
URL: https://github.com/apache/singa/pull/645#discussion_r402236819
##########
File path: python/singa/autograd.py
##########
@@ -697,15 +833,32 @@ def backward(self, dy):
def prelu(x, slope):
+ """
+ PRelu applies the function f(x) = slope * x for x < 0, f(x) = x for x >= 0
to the data tensor elementwise.
+ Args:
+ x: matrix.
+ Return:
+ the result Tensor
+ """
return PRelu()(x, slope)[0]
class Add(Operation):
+ """
+ Performs element-wise binary addition.
+ """
def __init__(self):
super(Add, self).__init__()
def forward(self, a, b):
+ """
+ Args:
+ a (CTensor): First operand..
Review comment:
fixed, and for other simple operators, such as or, and, etc, I also change
them like this.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services