larroy commented on a change in pull request #14779: [WIP] Fully connected,
higher order grad
URL: https://github.com/apache/incubator-mxnet/pull/14779#discussion_r305554797
##########
File path: tests/python/unittest/test_higher_order_grad.py
##########
@@ -173,6 +182,87 @@ def check_second_order_unary(x, op, grad_grad_op):
# Validate the gradients.
assert_almost_equal(expected_grad_grad, x.grad.asnumpy())
+def arange_shape_like(y):
+ shape = y.shape
+ nelems = reduce(mul, shape)
+ x = nd.arange(nelems).reshape(shape)
+ return x
+
+class RandomShapes(object):
Review comment:
Is it such a big problem in a unit test? I find it useful to generate inputs.
----------------------------------------------------------------
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