You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by ha...@apache.org on 2018/08/04 05:31:54 UTC
[incubator-mxnet] branch master updated: remove fixed seed for
test_sparse_ndarray/test_operator_gpu.test_sparse_nd_pickle (#12012)
This is an automated email from the ASF dual-hosted git repository.
haibin 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 067197f remove fixed seed for test_sparse_ndarray/test_operator_gpu.test_sparse_nd_pickle (#12012)
067197f is described below
commit 067197f544d0cff0b2afd1f2f4304ec07b52c48c
Author: Hao Jin <ha...@users.noreply.github.com>
AuthorDate: Sat Aug 4 01:31:47 2018 -0400
remove fixed seed for test_sparse_ndarray/test_operator_gpu.test_sparse_nd_pickle (#12012)
---
tests/python/unittest/test_sparse_ndarray.py | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/tests/python/unittest/test_sparse_ndarray.py b/tests/python/unittest/test_sparse_ndarray.py
index 508f523..7d3d580 100644
--- a/tests/python/unittest/test_sparse_ndarray.py
+++ b/tests/python/unittest/test_sparse_ndarray.py
@@ -514,24 +514,22 @@ def test_sparse_nd_astype_copy():
assert (id(x) == id(y))
-@with_seed(0)
+@with_seed()
def test_sparse_nd_pickle():
- repeat = 1
dim0 = 40
dim1 = 40
stypes = ['row_sparse', 'csr']
densities = [0, 0.5]
stype_dict = {'row_sparse': RowSparseNDArray, 'csr': CSRNDArray}
- for _ in range(repeat):
- shape = rand_shape_2d(dim0, dim1)
- for stype in stypes:
- for density in densities:
- a, _ = rand_sparse_ndarray(shape, stype, density)
- assert isinstance(a, stype_dict[stype])
- data = pkl.dumps(a)
- b = pkl.loads(data)
- assert isinstance(b, stype_dict[stype])
- assert same(a.asnumpy(), b.asnumpy())
+ shape = rand_shape_2d(dim0, dim1)
+ for stype in stypes:
+ for density in densities:
+ a, _ = rand_sparse_ndarray(shape, stype, density)
+ assert isinstance(a, stype_dict[stype])
+ data = pkl.dumps(a)
+ b = pkl.loads(data)
+ assert isinstance(b, stype_dict[stype])
+ assert same(a.asnumpy(), b.asnumpy())
# @kalyc: Getting rid of fixed seed as flakiness could not be reproduced