From 8bbc53b3a5dc0f191a950983554c6eb49815b72d Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 23 Jul 2020 22:36:46 +0000 Subject: [PATCH] move matrix generator to utils --- python/mxnet/test_utils.py | 7 +++++++ tests/nightly/test_large_array.py | 6 ------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/python/mxnet/test_utils.py b/python/mxnet/test_utils.py index 9a70f6e268e6..c2f4d7c923a8 100755 --- a/python/mxnet/test_utils.py +++ b/python/mxnet/test_utils.py @@ -297,6 +297,13 @@ def create_vector(size, dtype=np.int64): a = mx.nd.arange(0, size, dtype=dtype) return a +# For testing Large Square Matrix with total size > 2^32 elements +def get_large_identity_mat(): + A = nd.zeros((LARGE_SQ_X, LARGE_SQ_X)) + for i in range(LARGE_SQ_X): + A[i,i] = 1 + return A + def rand_sparse_ndarray(shape, stype, density=None, dtype=None, distribution=None, data_init=None, rsp_indices=None, modifier_func=None, shuffle_csr_indices=False, ctx=None): diff --git a/tests/nightly/test_large_array.py b/tests/nightly/test_large_array.py index 41691b1c12a1..39236c53b10c 100644 --- a/tests/nightly/test_large_array.py +++ b/tests/nightly/test_large_array.py @@ -1170,12 +1170,6 @@ def check_correctness(mxnet_op, numpy_op, atol=1e-3): def test_linalg(): - def get_large_identity_mat(): - A = nd.zeros((LARGE_SQ_X, LARGE_SQ_X)) - for i in range(LARGE_SQ_X): - A[i,i] = 1 - return A - def batchify(mat): return nd.array([mat.asnumpy()])