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 2020/10/16 00:41:07 UTC

[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #19310: fix numpy ediff1d large tensor

access2rohit commented on a change in pull request #19310:
URL: https://github.com/apache/incubator-mxnet/pull/19310#discussion_r505941746



##########
File path: tests/nightly/test_np_large_array.py
##########
@@ -2001,3 +2001,19 @@ def test_vstack():
     assert out2[0, -1] == 0 and out2[1, -1] == 1
     assert inp2.grad.shape == inp2.shape
     assert inp2.grad[-1, -1] == 1
+
+
+@use_np
+def test_ediff1d():
+    INT_OVERFLOW = 2**31
+    inp = np.zeros((2, INT_OVERFLOW))
+    inp[0, -1], inp[1, 0] = 1, 3
+    inp.attach_grad()
+    with mx.autograd.record():
+        out = np.ediff1d(inp, to_begin=-99, to_end=np.array([88, 99]))
+        out.backward()
+    assert out.shape == (2*INT_OVERFLOW-1+1+2, )

Review comment:
       nit: space b/w ops ? Is this according to PEP8 style ? Rest LGTM




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