ChaiBapchya commented on a change in pull request #18744:
URL: https://github.com/apache/incubator-mxnet/pull/18744#discussion_r460149896



##########
File path: tests/nightly/test_large_array.py
##########
@@ -1168,6 +1169,76 @@ def check_correctness(mxnet_op, numpy_op, atol=1e-3):
     check_binary_broadcast()
 
 
+def test_linalg():
+    def batchify(mat):
+        mat_np = mat.asnumpy()
+        return nd.array([mat_np, mat_np])
+
+    def check_diag(mat, val):
+        for i in range(LARGE_SQ_X):
+            assert mat[i, i] == val
+
+    def check_batch_diag(mat, val):
+        check_diag(mat[0], val)
+        check_diag(mat[1], val)
+
+    def run_det(inp):
+        inp.attach_grad()
+        with mx.autograd.record():
+            out = det(inp)
+        return inp.grad, out
+
+    def run_inverse(inp):
+        inp.attach_grad()
+        with mx.autograd.record():
+            out = inverse(inp)
+        return inp.grad, out
+
+    def run_trmm(inp):
+        inp.attach_grad()
+        with mx.autograd.record():
+            out = trmm(inp, inp)
+        return inp.grad, out
+
+    def run_trsm(inp):
+        inp.attach_grad()
+        with mx.autograd.record():
+            out = trsm(inp, inp)

Review comment:
       You can run these tests with
   ```
   pytest tests/nightly/test_large_array.py::<insert function_name>
   ```




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to