anirudhacharya commented on a change in pull request #12967: [MXNET-1173] Debug
operators - isfinite, isinf and isnan
URL: https://github.com/apache/incubator-mxnet/pull/12967#discussion_r228696349
##########
File path: tests/python/unittest/test_ndarray.py
##########
@@ -1495,6 +1495,45 @@ def test_dlpack():
mx.test_utils.assert_almost_equal(a_np, d_np)
mx.test_utils.assert_almost_equal(a_np, e_np)
+@with_seed()
+def test_ndarray_is_inf():
+ random_dimensions = np.random.randint(3, 5)
+ random_shape = [np.random.randint(2, 5) for i in range(random_dimensions)]
+ data = mxnet.test_utils.rand_ndarray(random_shape,'default')
+ data[0][0][0]=np.inf
Review comment:
the dimensions for setting of nan and np.inf values can be randomized too.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services