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 2019/09/12 08:12:09 UTC

[GitHub] [incubator-mxnet] gyshi commented on a change in pull request #16025: Numpy add numpy op left_shift and right_shift

gyshi commented on a change in pull request #16025: Numpy add numpy op left_shift and right_shift
URL: https://github.com/apache/incubator-mxnet/pull/16025#discussion_r323609421
 
 

 ##########
 File path: tests/python/unittest/test_numpy_op.py
 ##########
 @@ -1647,6 +1647,50 @@ def hybrid_forward(self, F, a):
                         assert_almost_equal(mx_out.asnumpy(), np_out, rtol=1e-3, atol=1e-5)
 
 
+@with_seed()
+@use_np
+def test_np_shifts():
+    class TestShift(HybridBlock):
+            def __init__(self, func):
+                super(TestShift, self).__init__()
+                self._func = func
+
+            def hybrid_forward(self, F, a, b):
+                return getattr(F.np, self._func)(a, b)
+
+    shapes = [
+        ((), ()),
+        ((), (2,)),
+        ((3,), ()),
+        ((3, 4), (3, 4)),
+        ((3, 4, 5, 6), (6,)),
+        ((2, 0, 3), (3,)),
+        ((2, 1, 3), (2, 3))
+    ]
+    dtypes = ['uint8', 'int8', 'int32', 'int64']
 
 Review comment:
   sorry, left_shift does not support floating dtype. and in the backend, if dtype is floating type, it will raise error. i think we should not give floating type case.

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