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



##########
File path: tests/nightly/test_np_large_array.py
##########
@@ -665,6 +665,24 @@ def test_subtract():
     assert B.grad.shape == (INT_OVERFLOW, 2)
     assert B.grad[0][0] == -1
 
+@use_np
+def test_polyval():
+    poly = np.array([1, 1, 5])
+    inp = np.zeros((2, INT_OVERFLOW))
+    inp[-1, -1] = 2
+    poly.attach_grad()
+    inp.attach_grad()
+    with mx.autograd.record():
+        out = np.polyval(poly, inp)
+        out.backward()
+    assert out.shape == inp.shape
+    assert out[-1, -1] == 11 and out[0, 0] == 5
+    assert inp.grad.shape == inp.shape
+    assert inp.grad[-1, -1] == 5
+    assert poly.grad.shape == poly.shape
+    assert poly.grad[0] == 4

Review comment:
       i understood the gradient of input. Can you explain gradient for poly ?




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


Reply via email to