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/07/24 16:00:51 UTC

[GitHub] [incubator-mxnet] ChaiBapchya commented on a change in pull request #18744: [v1.x] add linalg large matrix tests

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



##########
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:
       I don't see `trsm`/`inverse`/`det`/`trmm` or any of these ops being imported from `mx.nd.linalg` namespace.
   How is it being accessed? Do these tests work? Can you please paste the results?




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