piiswrong closed pull request #9889: Fix doc in autograd.Function
URL: https://github.com/apache/incubator-mxnet/pull/9889
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/python/mxnet/autograd.py b/python/mxnet/autograd.py
index 2eb04737a3..608733d5c8 100644
--- a/python/mxnet/autograd.py
+++ b/python/mxnet/autograd.py
@@ -382,7 +382,7 @@ def backward(self, dy):
# backward takes as many inputs as forward's return value,
# and returns as many NDArrays as forward's arguments.
y, = self.saved_tensors
- return y * (1-y)
+ return dy * y * (1-y)
Then, the function can be used in the following way::
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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