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/10/17 00:07:47 UTC

[GitHub] [incubator-mxnet] anirudh2290 commented on a change in pull request #16416: Dgl ops 2

anirudh2290 commented on a change in pull request #16416: Dgl ops 2
URL: https://github.com/apache/incubator-mxnet/pull/16416#discussion_r335761376
 
 

 ##########
 File path: tests/nightly/test_large_array.py
 ##########
 @@ -1199,6 +1185,118 @@ def test_full():
     assert a[-1][-1] == 3
 
 
+def test_hyperbolic():
+    def test_arccosh(a):
+        mx_res = mx.nd.arccosh(a)
+        assert_almost_equal(mx_res[-1][-1].asnumpy(), np.arccosh(a[-1][-1].asnumpy()))
+
+    def test_arcsinh(a):
+        mx_res = mx.nd.arcsinh(a)
+        assert_almost_equal(mx_res[-1][-1].asnumpy(), np.arcsinh(a[-1][-1].asnumpy()))
+
+    def test_arctanh(a):
+        a[-1][-1] = 0   # arctanh of 1 is inf, assert_almost_equal gives "divide by 0" for comparing 2 inf values
+        mx_res = mx.nd.arctanh(a)
+        assert_almost_equal(mx_res[-1][-1].asnumpy(), np.arctanh(a[-1][-1].asnumpy()))
+
+    def test_cosh(a):
+        mx_res = mx.nd.cosh(a)
+        assert_almost_equal(mx_res[-1][-1].asnumpy(), np.cosh(a[-1][-1].asnumpy()))
+
+    def test_sinh(a):
+        mx_res = mx.nd.sinh(a)
+        assert_almost_equal(mx_res[-1][-1].asnumpy(), np.sinh(a[-1][-1].asnumpy()))
+
+    def test_tanh(a):
+        mx_res = mx.nd.tanh(a)
+        assert_almost_equal(mx_res[-1][-1].asnumpy(), np.tanh(a[-1][-1].asnumpy()))
+
+    a = mx.nd.ones((LARGE_X, SMALL_Y))
+    test_arccosh(a)
+    test_arcsinh(a)
+    test_arctanh(a)
+    test_cosh(a)
+    test_sinh(a)
+    test_tanh(a)
+
+
+def test_sign():
+    a = mx.nd.random.normal(-1,1, shape=(LARGE_X, SMALL_Y))
+    mx_res = mx.nd.sign(a)
+    assert_almost_equal(mx_res[-1][-1].asnumpy(), np.sign(a[-1][-1].asnumpy()))
+
+
+def test_logical():
+    def test_logical_and(a, b):
+        mx_res = mx.nd.logical_and(a, b)
 
 Review comment:
   all tests here test logical_and 

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