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/06 21:32:49 UTC

[GitHub] [incubator-mxnet] sxjscience commented on a change in pull request #19059: Numpy large tensor tests batch 3

sxjscience commented on a change in pull request #19059:
URL: https://github.com/apache/incubator-mxnet/pull/19059#discussion_r500608680



##########
File path: tests/nightly/test_np_large_array.py
##########
@@ -163,28 +149,27 @@ def test_all():
 
 @use_np
 def test_amin():
-    A = np.ones((INT_OVERFLOW, 2))
-    A[100][1] = -1
-    A.attach_grad()
+    inp = np.ones((INT_OVERFLOW, 2))
+    inp[-1, -1] = -1
+    inp.attach_grad()
     with mx.autograd.record():
-        B = np.amin(A)
-    assert B == -1.0
-    B.backward()
-    assert A.grad.shape == (INT_OVERFLOW, 2)
-    assert A.grad[0][0] == 0
+        out = np.amin(inp)
+        out.backward()
+    assert out == -1.0
+    assert inp.grad.shape == (INT_OVERFLOW, 2)
+    assert inp.grad[0][0] == 0

Review comment:
       Need to assert inp.grad[-1, -1] == 1




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