nudles commented on a change in pull request #645: add function comments for
autograd
URL: https://github.com/apache/singa/pull/645#discussion_r402064961
##########
File path: python/singa/autograd.py
##########
@@ -631,16 +712,39 @@ def backward(self, dy):
def add_bias(x, b, axis=0):
+ """
+ Add Bias to each row / column of the Tensor, depending on the axis arg.
+ Args:
+ x: matrix.
+ b (CTensor): bias to be added.
+ axis (int): 0 or 1, default is 0.
+ Return:
+ the result Tensor
+ """
return AddBias(axis)(x, b)[0]
-
class Reshape(Operation):
+ """
+ Reshape the input tensor similar to numpy.reshape.
+ """
def __init__(self, shape):
+ """
+ Args:
+ shape: Specified shape for output. At most one dimension of the
new shape can be -1. In this case,
Review comment:
try to keep the length of a line within 80.
----------------------------------------------------------------
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