You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by sk...@apache.org on 2018/08/23 15:45:13 UTC
[incubator-mxnet] branch master updated: re-enable randomized
test_ndarray_pickle (#12292)
This is an automated email from the ASF dual-hosted git repository.
skm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push:
new 8ee8357 re-enable randomized test_ndarray_pickle (#12292)
8ee8357 is described below
commit 8ee8357375495fcfe54aac3f2960e46a6350ee93
Author: Hao Jin <ha...@users.noreply.github.com>
AuthorDate: Thu Aug 23 08:45:01 2018 -0700
re-enable randomized test_ndarray_pickle (#12292)
---
tests/python/unittest/test_ndarray.py | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/tests/python/unittest/test_ndarray.py b/tests/python/unittest/test_ndarray.py
index c9bc0cd..e354dcd 100644
--- a/tests/python/unittest/test_ndarray.py
+++ b/tests/python/unittest/test_ndarray.py
@@ -240,20 +240,18 @@ def test_ndarray_scalar():
assert(np.sum(d.asnumpy()) < 1e-5)
-@with_seed(0)
+@with_seed()
def test_ndarray_pickle():
maxdim = 5
- nrepeat = 10
- for repeat in range(nrepeat):
- for dim in range(1, maxdim):
- a = random_ndarray(dim)
- b = mx.nd.empty(a.shape)
- a[:] = np.random.uniform(-10, 10, a.shape)
- b[:] = np.random.uniform(-10, 10, a.shape)
- a = a + b
- data = pkl.dumps(a)
- a2 = pkl.loads(data)
- assert np.sum(a.asnumpy() != a2.asnumpy()) == 0
+ for dim in range(1, maxdim):
+ a = random_ndarray(dim)
+ b = mx.nd.empty(a.shape)
+ a[:] = np.random.uniform(-10, 10, a.shape)
+ b[:] = np.random.uniform(-10, 10, a.shape)
+ a = a + b
+ data = pkl.dumps(a)
+ a2 = pkl.loads(data)
+ assert np.sum(a.asnumpy() != a2.asnumpy()) == 0
@with_seed()