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/01/07 19:08:14 UTC

[GitHub] [incubator-mxnet] haojin2 commented on a change in pull request #16990: [numpy] add op matmul

haojin2 commented on a change in pull request #16990: [numpy] add op matmul
URL: https://github.com/apache/incubator-mxnet/pull/16990#discussion_r363903209
 
 

 ##########
 File path: tests/python/unittest/test_numpy_op.py
 ##########
 @@ -418,6 +418,144 @@ def hybrid_forward(self, F, a, b):
                                        rtol=1e-1, atol=1e-1, dtype=dtype)
 
 
+@with_seed()
+@use_np
+def test_np_matmul():
+    class TestMatmul(HybridBlock):
+        def __init__(self):
+            super(TestMatmul, self).__init__()
+
+        def hybrid_forward(self, F, a, b):
+            return F.np.matmul(a, b)
+
+    def matmul_backward(a, b):
+        if (a.ndim < 1) or (b.ndim < 1):
+            raise ValueError('An input is zero-dim')
 
 Review comment:
   I think this case is never going to be hit, you can simply remove this raise from this function

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


With regards,
Apache Git Services