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()])