haojin2 commented on a change in pull request #17904: [Numpy] add: numpy op 
trilindices
URL: https://github.com/apache/incubator-mxnet/pull/17904#discussion_r400586225
 
 

 ##########
 File path: tests/python/unittest/test_numpy_op.py
 ##########
 @@ -6693,6 +6693,35 @@ def test_np_builtin_op_signature():
         assert op is not None
         assert str(op.__signature__) == str(inspect.signature(_op_from_doc))
 
+@with_seed()
+@use_np
+def test_np_tril_indices():
+    class TestTrilindices(HybridBlock):
+        def __init__(self, n, k=0, m=None):
+            super(TestTrilindices, self).__init__()
+            self._n = n;
+            self._k = k;
+            if m is None:
+                m = n
+            self._m = m
+        
+        def hybrid_forward(self, F, x, *args, **kwargs):
+            return x, F.np.tril_indices(n=self._n, k=self._k, m=self._m)
+    
+    for n in _np.random.random_integers(-10, 50, 10):
+        for k in _np.random.random_integers(-50, 50, 4):
+            for m in _np.random.random_integers(-10, 50, 4):
+                np_out = _np.tril_indices(n, k, m)
+                for hybridize in [True, False]:
+                    # dummy nparray for hybridize
+                    x = mx.nd.ones((1,1)).as_np_ndarray()
 
 Review comment:
   simply do `x = np.ones((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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to