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

 ##########
 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:
   Makes sense, but for convenience I prefer to test with Gluon. I don't think 
is worth the complexity and extra work now. Let me know if you disagree. 
Extending this argument the test should be in C++, we are testing like this all 
the time.

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

Reply via email to