mxnet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-mxnet] tingying2020 commented on a change in pull request #16126: [numpy] operator around
Date Thu, 12 Sep 2019 12:41:54 GMT
tingying2020 commented on a change in pull request #16126: [numpy] operator around
URL: https://github.com/apache/incubator-mxnet/pull/16126#discussion_r323716956
 
 

 ##########
 File path: tests/python/unittest/test_numpy_op.py
 ##########
 @@ -1647,6 +1647,40 @@ 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_around():
+    class TestAround(HybridBlock):
+        def __init__(self, decimals):
+            super(TestAround, self).__init__()
+            # necessary initializations
+            self.decimals = decimals
+
+        def hybrid_forward(self, F, x):
+            return F.np.around(x, self.decimals)
+    
+    shapes = [(), (1,), (1, 1), (1, 2, 3), (1, 0), (3, 0, 2)] # test_shapes, remember to
include zero-dim shape and zero-size shapes
 
 Review comment:
   Done.

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

Mime
View raw message