haojin2 commented on a change in pull request #15906: [Numpy] Numpy operator 
diff
URL: https://github.com/apache/incubator-mxnet/pull/15906#discussion_r317878722
 
 

 ##########
 File path: tests/python/unittest/test_numpy_op.py
 ##########
 @@ -880,6 +880,69 @@ def get_new_shape(shape, axis):
                 assert_almost_equal(mx_out.asnumpy(), np_out, rtol=1e-3, 
atol=1e-5)
 
 
+@with_seed()
+@use_np
+def test_np_diff():
+    def np_diff_backward(ograd, n, axis):
+        res = ograd
+        for i in range(n):
+            res = _np.negative(_np.diff(res, n=1, axis=axis, prepend=0, 
append=0))
+        return res
+
+    @use_np
 
 Review comment:
   get rid of this line.

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