[GitHub] [incubator-mxnet] apeforest commented on a change in pull request #15794: Add power, exponent, log ops large tensor support

2019-08-08 Thread GitBox
apeforest commented on a change in pull request #15794: Add power, exponent, 
log ops large tensor support
URL: https://github.com/apache/incubator-mxnet/pull/15794#discussion_r312270824
 
 

 ##
 File path: tests/nightly/test_large_array.py
 ##
 @@ -351,6 +351,69 @@ def test_topk():
 l = nd.topk(b, k=1, axis=-1, dtype=np.int64, ret_typ="value")
 assert l.sum() == np.sum(np.arange(0, SMALL_Y))
 
+def test_exponent_logarithm_operators():
+a = 2*nd.ones(shape=(LARGE_X, SMALL_Y))
 
 Review comment:
   maybe we should change create_2d_array to make it more efficient.


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


[GitHub] [incubator-mxnet] apeforest commented on a change in pull request #15794: Add power, exponent, log ops large tensor support

2019-08-08 Thread GitBox
apeforest commented on a change in pull request #15794: Add power, exponent, 
log ops large tensor support
URL: https://github.com/apache/incubator-mxnet/pull/15794#discussion_r311867155
 
 

 ##
 File path: tests/nightly/test_large_array.py
 ##
 @@ -351,6 +351,69 @@ def test_topk():
 l = nd.topk(b, k=1, axis=-1, dtype=np.int64, ret_typ="value")
 assert l.sum() == np.sum(np.arange(0, SMALL_Y))
 
+def test_exponent_logarithm_operators():
+a = 2*nd.ones(shape=(LARGE_X, SMALL_Y))
 
 Review comment:
   reuse create_2d_tensor?


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


[GitHub] [incubator-mxnet] apeforest commented on a change in pull request #15794: Add power, exponent, log ops large tensor support

2019-08-08 Thread GitBox
apeforest commented on a change in pull request #15794: Add power, exponent, 
log ops large tensor support
URL: https://github.com/apache/incubator-mxnet/pull/15794#discussion_r311867197
 
 

 ##
 File path: tests/nightly/test_large_array.py
 ##
 @@ -351,6 +351,69 @@ def test_topk():
 l = nd.topk(b, k=1, axis=-1, dtype=np.int64, ret_typ="value")
 assert l.sum() == np.sum(np.arange(0, SMALL_Y))
 
+def test_exponent_logarithm_operators():
+a = 2*nd.ones(shape=(LARGE_X, SMALL_Y))
+# exponent
+result = nd.exp(a)
+assert result[0][-1] == 7.389056
+assert result.shape == a.shape
+
+# exponent minus 1
+result = nd.expm1(a)
+assert result[0][-1] == 6.389056
+assert result.shape == a.shape
+
+# log2
+result = nd.log2(a)
+assert result[0][-1] == 1
+assert result.shape == a.shape
+
+# log10
+result = nd.log10(a)
+assert result[0][-1] == 0.30103
+assert result.shape == a.shape
+
+# log1p
+result = nd.log1p(a)
+assert result[0][-1] == 1.0986123
+assert result.shape == a.shape
+
+# log
+result = nd.log(a)
+assert result[0][-1] == 0.6931472
+assert result.shape == a.shape
+
+def test_power_operators():
+a = 2*nd.ones(shape=(LARGE_X, SMALL_Y))
 
 Review comment:
   use create_2d_tensor?


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