You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/06/26 21:10:29 UTC

[GitHub] [incubator-mxnet] larroy commented on a change in pull request #14779: Fully connected, higher order grad

larroy commented on a change in pull request #14779: Fully connected, higher order grad
URL: https://github.com/apache/incubator-mxnet/pull/14779#discussion_r297868293
 
 

 ##########
 File path: tests/python/unittest/test_higher_order_grad.py
 ##########
 @@ -129,6 +131,44 @@ def check_second_order_unary(x, op, grad_grad_op):
     # Validate the gradients.
     assert_almost_equal(expected_grad_grad, x.grad.asnumpy())
 
+class RandomShapes(object):
+    def __init__(self, dim):
+        self.dim = dim
+        self.curdim = 1
+
+    def __iter__(self):
+        return self
+
+    def next(self):
+        return self.__next__()
+
+    def __next__(self):
+        if self.curdim > self.dim:
+            raise StopIteration
+        shape = rand_shape_nd(self.curdim)
+        print(shape)
+        x = nd.random.normal(shape=shape)
+        self.curdim += 1
+        return x
+
+
+@with_seed()
+def test_dense_backward():
 
 Review comment:
   Dense calls FullyConnected during forward, do you suggest to use the symbolic API?

----------------------------------------------------------------
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